- 
                    What is the purpose of the enableEvents() methodThe enableEvents() method is used to enable an event for a particular object. Normally,an event is enabled when a listener is added to an object for a particular event. TheenableEvents() method is used by objects that handle events by overriding their eventdispatchmethods. 
- 
                    What interface must an object implement before it can be written to astream as an objectAn object must implement the Serializable or Externalizable interface before it can bewritten to a stream as an object. 
- 
                    How are this and super usedThis is used to refer to the current object instance. super is used to refer to the variablesand methods of the superclass of the current object instance. 
- 
                    What is a compilation unitA compilation unit is a Java source code file. 
- 
                    What interface is extended by AWT event listenersAll AWT event listeners extend the java.util.EventListener interface. 
- 
                    What happens if an exception is not caughtAn uncaught exception results in the uncaughtException() method of the thread'sThreadGroup being invoked, which eventually results in the termination of the programin which it is thrown. 
- 
                    What is a layout managerA layout manager is an object that is used to organize components in a container. 
- 
                    Which arithmetic operations can result in the throwing of an ArithmeticExceptionInteger / and % can result in the throwing of an ArithmeticException. 
- 
                    What are three ways in which a thread can enter the waiting stateA thread can enter the waiting state by invoking its sleep() method, by blocking on I/O,by unsuccessfully attempting to acquire an object's lock, or by invoking an object's wait()method. It can also enter the waiting state by invoking its (deprecated) suspend() method. 
- 
                    Can an abstract class be finalAn abstract class may not be declared as final. 
- 
                    What is the ResourceBundle classThe ResourceBundle class is used to store locale-specific resources that can be loaded bya program to tailor the program's appearance to the particular locale in which it is beingrun. 
- 
                    What is the difference between a Scrollbar and a ScrollPaneA Scrollbar is a Component, but not a Container. A ScrollPane is a Container. AScrollPane handles its own events and performs its own scrolling. 
- 
                    What is the difference between a public and a non-public classA public class may be accessed outside of its package. A non-public class may not beaccessed outside of its package. 
- 
                    To what value is a variable of the boolean type automatically initializedThe default value of the boolean type is false. 
- 
                    What is the difference between the prefix and postfix forms of the ++ operatorThe prefix form performs the increment operation and returns the value of the incrementoperation. The postfix form returns the current value all of the expression and thenperforms the increment operation on that value. 
- 
                    What is the purpose of a statement blockA statement block is used to organize a sequence of statements as a single statementgroup. 
- 
                    What are the Object and Class classes used forThe Object class is the highest-level class in the Java class hierarchy. The Class class isused to represent the classes and interfaces that are loaded by a Java program.. 
- 
                    Can an unreachable object become reachable againAn unreachable object may become reachable again. This can happen when the object'sfinalize() method is invoked and the object performs an operation which causes it tobecome accessible to reachable objects. 
- 
                    When is an object subject to garbage collectionAn object is subject to garbage collection when it becomes unreachable to the program inwhich it is used. 
- 
                    What method must be implemented by all threadsAll tasks must implement the run() method, whether they are a subclass of Thread orimplement the Runnable interface. 
Java Interview Questions

 
  
  
  
		
Ans