-
What is the difference between a MenuItem and a CheckboxMenuItem
The CheckboxMenuItem class extends the MenuItem class to support a menu item thatmay be checked or unchecked.
-
Can an anonymous class be declared as implementing an interface and extending aclass
An anonymous class may implement an interface or extend a superclass, but may not bedeclared to do both.
-
-
-
What is the GregorianCalendar class
The GregorianCalendar provides support for traditional Western calendars.
-
-
What method is invoked to cause an object to begin executing as a separate thread
The start() method of the Thread class is invoked to cause an object to begin executing asa separate thread.
-
-
How are commas used in the intialization and iteration parts of a for statement
Commas are used to separate multiple statements within the initialization and iterationparts of a for statement.
-
What is an abstract method
An abstract method is a method whose implementation is deferred to a subclass.
-
What are the high-level thread states
The high-level thread states are ready, running, waiting, and dead.
-
What value does read() return when it has reached the end of a file
The read() method returns -1 when it has reached the end of a file.
-
Can a Byte object be cast to a double value
No, an object cannot be cast to a primitive value.
-
What is the difference between a static and a non-static inner class
A non-static inner class may have object instances that are associated with instances ofthe class's outer class. A static inner class does not have any object instances.
-
What is the % operator
It is referred to as the modulo or remainder operator. It returns the remainder of dividingthe first operand by the second operand.
-
What is the difference between a Window and a Frame
The Frame class extends Window to define a main application window that can have amenu bar.
-
Which class is extended by all other classes
The Object class is extended by all other classes.
-
Can an object be garbage collected while it is still reachable
A reachable object cannot be garbage collected. Only unreachable objects may begarbage collected..
-
What is the difference between the Font and FontMetrics classes
The FontMetrics class is used to define implementation-specific properties, such asascent and descent, of a Font object.
-
What happens when a thread cannot acquire a lock on an object
If a thread attempts to execute a synchronized method or synchronized statement and isunable to acquire an object's lock, it enters the waiting state until the lock becomesavailable.
Java Interview Questions
Ans