KyaPoocha.com

Huge Collection of Interview Questions


Archive for September, 2006

Can an unreachable object become reachable again? 

An unreachable object may become reachable again. This can happen when the object’s finalize() method is invoked and the object performs an operation which... Read more »

How do I serialize an object to a file? 

The class whose instances are to be serialized should implement an interface Serializable. Then you pass the instance to the ObjectOutputStream which is connected... Read more »

Which methods of Serializable interface should I implement? 

The serializable interface is an empty interface, it does not contain any methods. So we do not implement any methods.  Read more »

How can I customize the seralization process? i.e. how can one have a control over the serialization process? 

Yes it is possible to have control over serialization process. The class should implement Externalizable interface. This interface contains two methods namely readExternal... Read more »

What is the common usage of serialization? 

Whenever an object is to be sent over the network, objects need to be serialized. Moreover if the state of an object is to be saved, objects need to be serilazed.  Read more »

When you serialize an object, what happens to the object references included in the object? 

The serialization mechanism generates an object graph for serialization. Thus it determines whether the included object references are serializable or not. This... Read more »

What one should take care of while serializing the object? 

One should make sure that all the included objects are also serializable. If any of the objects is not serializable then it throws a NotSerializableException.  Read more »

What happens to the static fields of a class during serialization? 

There are three exceptions in which serialization doesnot necessarily read and write to the stream. These are 1. Serialization ignores static fields, because they... Read more »

Does importing a package imports the subpackages as well? 

No you will have to import the subpackages explicitly. For eg: Importing com.MyTest.* will import classes in the package MyTest only. It will not import any class... Read more »

What is the sequence for calling the methods by AWT for applets? 

When an applet begins, the AWT calls the following methods, in this sequence: init() start() paint() When an applet is terminated, the following sequence of method... Read more »

What are the Applet’s Life Cycle methods? Explain them? 

Following are methods in the life cycle of an Applet: init() method - called when an applet is first loaded. This method is called only once in the entire cycle... Read more »

Are there any third party logging components available? 

Log4net is a port of the established log4j Java logging component.  Read more »

Does the .NET Framework have in-built support for serialization? 

There are two separate mechanisms provided by the .NET class library - XmlSerializer and SoapFormatter/BinaryFormatter. Microsoft uses XmlSerializer for Web Services,... Read more »

Is it true that objects don’t always get destroyed immediately when the last reference goes away? 

Yes. The garbage collector offers no guarantees about the time when an object will be destroyed and its memory reclaimed.  Read more »

What is the difference between a private assembly and a shared assembly? 

Location and visibility: A private assembly is normally used by a single application, and is stored in the application’s directory, or a sub-directory beneath.... Read more »

Page 2 of 8«12345»...Last »