-
What state is a thread in when it is executing
An executing thread is in the running state.
-
-
Are true and false keywords
The values true and false are not keywords.
-
Use of abstract class and interface
What is the exact use of abstract class and interface?
-
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.
-
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.
-
What is the difference between a Scrollbar and a ScrollPane
A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. AScrollPane handles itsown events and performs its own scrolling.
-
What is a void return type
A void return type indicates that a method does not return a value.
-
What happens when you add a double value to a String
The result is a String object.
-
-
What restrictions are placed on method overloading
Two methods may not have the same name and argument list but different return types.
-
What is the return type of a program's main() method
A program's main() method has a void return type.
-
Name four Container classes
Window, Frame, Dialog, FileDialog, Panel, Applet, or ScrollPane
-
What class allows you to read objects directly from a stream
The ObjectInputStream class supports the reading of objects from input streams.
-
Which non-Unicode letter characters may be used as the first character of anidentifier
The non-Unicode letter characters $ and _ may appear as the first character of anidentifier
-
How can the Checkbox class be used to create a radio button
By associating Checkbox objects with a CheckboxGroup.
-
What class of exceptions are generated by the Java run-time system
The Java runtime system generates RuntimeException and Error exceptions.
-
-
What is the difference between a field variable and a local variable
A 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.
-
How are this() and super() used with constructors
This() is used to invoke a constructor of the same class. super() is used to invoke asuperclass constructor.
Java Interview Questions
Ans