-
Can a for statement loop indefinitely
Yes, a for statement can loop indefinitely. For example, consider the following:for(;;) ;
-
-
What are wrapped classes
Wrapped classes are classes that allow primitive types to be accessed as objects.
-
What is the % operator
It is referred to as the modulo or remainder operator. It returns the remainder of dividingthe first operandby the second operand.
-
What is the relationship between the Canvas class and the Graphics class
A Canvas object provides access to a Graphics object via its paint() method.
-
What is the range of the char type
The range of the char type is 0 to 2^16 - 1.
-
Which Java operator is right associative
The = operator is right associative.
-
How many times may an object's finalize() method be invoked by the garbagecollector
An object's finalize() method may only be invoked once by the garbage collector.
-
-
To what value is a variable of the String type automatically initialized
The default value of an String type is null.
-
Name two subclasses of the TextComponent class
TextField and TextArea
-
What are the high-level thread states
The high-level thread states are ready, running, waiting, and dead.
-
What is an abstract method
An abstract method is a method whose implementation is deferred to a subclass.
-
-
Name three subclasses of the Component class
Box.Filler, Button, Canvas, Checkbox, Choice, Container, Label, List, Scrollbar, orTextComponent
-
-
-
What is the range of the short type
The range of the short type is -(2^15) to 2^15 - 1.
-
When a thread is created and started, what is its initial state
A thread is in the ready state after it has been created and started.
-
What class is the top of the AWT event hierarchy
The java.awt.AWTEvent class is the highest-level class in the AWT event-classhierarchy.
Java Interview Questions
Ans