- 
                    If a method is declared as protected, where may the method be accessedA protected method may only be accessed by classes or interfaces of the same package orby subclasses ofthe class in which it is declared. 
- 
                    How can the Checkbox class be used to create a radio buttonBy associating Checkbox objects with a CheckboxGroup. 
- 
                    Which non-Unicode letter characters may be used as the first character of anidentifierThe non-Unicode letter characters $ and _ may appear as the first character of anidentifier 
- 
                    What restrictions are placed on method overloadingTwo methods may not have the same name and argument list but different return types. 
- 
                    What is the return type of a program's main() methodA program's main() method has a void return type. 
- 
                    Name four Container classesWindow, Frame, Dialog, FileDialog, Panel, Applet, or ScrollPane 
- 
                    What class of exceptions are generated by the Java run-time systemThe Java runtime system generates RuntimeException and Error exceptions. 
- 
                    What class allows you to read objects directly from a streamThe ObjectInputStream class supports the reading of objects from input streams. 
- 
                    What is the difference between a field variable and a local variableA field variable is a variable that is declared as a member of a class. A local variable is avariable that isdeclared local to a method. 
- 
                    Under what conditions is an object's finalize() method invoked by the garbagecollectorThe garbage collector invokes an object's finalize() method when it detects that the objecthas becomeunreachable. 
- 
                    How are this() and super() used with constructorsThis() is used to invoke a constructor of the same class. super() is used to invoke asuperclass constructor. 
- 
                    What is the relationship between a method's throws clause and the exceptionsthat can bethrown during the method's executionA method's throws clause must declare any checked exceptions that are not caught withinthe body of themethod. 
- 
                    Why are the methods of the Math class staticSo they can be invoked as if they are a mathematical code library. 
- 
                    
- 
                    What state is a thread in when it is executingAn executing thread is in the running state. 
- 
                    What are the legal operands of the instanceof operatorThe left operand is an object reference or null value and the right operand is a class,interface, or array type. 
- 
                    How are the elements of a GridLayout organizedThe elements of a GridBad layout are of equal size and are laid out using the squares of agrid. 
- 
                    What an I/O filterAn I/O filter is an object that reads from one stream and writes to another, usuallyaltering the data in someway as it is passed from one stream to another. 
- 
                    If an object is garbage collected, can it become reachable againOnce an object is garbage collected, it ceases to exist. It can no longer become reachableagain. 
- 
                    What is the Set interfaceThe Set interface provides methods for accessing the elements of a finite mathematicalset. Sets do notallow duplicate elements. 
Java Interview Questions

 
  
  
  
		
Ans