-
How can the Checkbox class be used to create a radio button
By associating Checkbox objects with a CheckboxGroup.
-
Which non-Unicode letter characters may be used as the first characterof an identifier
The non-Unicode letter characters $ and _ may appear as the first character of anidentifier
-
What restrictions are placed on method overloading
Two methods may not have the same name and argument list but different return types.
-
What happens when you invoke a thread's interrupt method while it issleeping or waiting
When a task's interrupt() method is executed, the task enters the ready state. The nexttime the task enters the running state, an InterruptedException is thrown.
-
What is casting
There are two types of casting, casting between primitive numeric types and castingbetween object references. Casting between numeric types is used to convert largervalues, such as double values, to smaller values, such as byte values. Casting betweenobject references is used to refer to an object by a compatible class, interface, or arraytype reference.
-
-
What is the difference between a Choice and a List
A Choice is displayed in a compact form that requires you to pull it down to see the listof available choices. Only one item may be selected from a Choice. A List may bedisplayed in such a way that several List items are visible. A List supports the selectionof one or more List items.
-
What class of exceptions are generated by the Java run-time system
The Java runtime system generates RuntimeException and Error exceptions.
-
What class allows you to read objects directly from a stream
The ObjectInputStream class supports the reading of objects from input streams.
-
Under what conditions is an object's finalize() method invoked by the garbagecollector
The garbage collector invokes an object's finalize() method when it detects that the objecthas become unreachable.
-
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.
-
-
What state is a thread in when it is executing
An executing thread is in the running state.
-
How are the elements of a GridLayout organized
The elements of a GridBad layout are of equal size and are laid out using the squares of agrid.
-
What an I/O filter
An I/O filter is an object that reads from one stream and writes to another, usuallyaltering the data in some way as it is passed from one stream to another.
-
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.
-
What is the Set interface
The Set interface provides methods for accessing the elements of a finite mathematicalset. Sets do not allow duplicate elements.
-
What classes of exceptions may be thrown by a throw statement
A throw statement may throw any expression that may be assigned to the Throwabletype.
-
What are E and PI
E is the base of the natural logarithm and PI is mathematical value pi.
-
What is a void return type
A void return type indicates that a method does not return a value.
Java Interview Questions
Ans