-
When is an object subject to garbage collection
An object is subject to garbage collection when it becomes unreachable to the program inwhich it is used.
-
If an object is garbage collected, can it become reachable again
Once an object is garbage collected, it ceases to exist. It can no longer become reachableagain.
-
Use of abstract class and interface
What is the exact use of abstract class and interface?
-
Are true and false keywords
The values true and false are not keywords.
-
-
What state is a thread in when it is executing
An executing thread is in the running state.
-
Which arithmetic operations can result in the throwing of anArithmeticException
Integer / and % can result in the throwing of an ArithmeticException.
-
What interface is extended by AWT event listeners
All AWT event listeners extend the java.util.EventListener interface.
-
What is the List interface
The List interface provides support for ordered collections of objects.
-
-
Does Java have destructors?
No garbage collector does the job working in the background
-
How can a dead thread be restarted
A dead thread cannot be restarted.
-
What is a layout manager
A layout manager is an object that is used to organize components in a container.
-
What modifiers may be used with a top-level class
A top-level class may be public, abstract, or final.
-
What is the purpose of a statement block
A statement block is used to organize a sequence of statements as a single statementgroup.
-
To what value is a variable of the boolean type automatically initialized
The default value of the boolean type is false.
-
-
Is &&= a valid Java operator
No, it is not.
-
What is the Map interface
The Map interface replaces the JDK 1.1 Dictionary class and is used associate keys withvalues.
-
What is the SimpleTimeZone class
The SimpleTimeZone class provides support for a Gregorian calendar.
Java Interview Questions
Ans