-
What is the purpose of the System class
The purpose of the System class is to provide access to system resources.
-
-
How are the elements of a CardLayout organized
The elements of a CardLayout are stacked, one on top of the other, like a deck of cards.
-
Is &&= a valid Java operator
No, it is not.
-
Name the eight primitive Java types
The eight primitive types are byte, char, short, int, long, float, double, and boolean.
-
Which class should you use to obtain design information about an object
The Class class is used to obtain information about an object's design.
-
What is the relationship between clipping and repainting
When a window is repainted by the AWT painting thread, it sets the clipping regions tothe area of thewindow that requires repainting.
-
What restrictions are placed on the values of each case of a switch statement
During compilation, the values of each case of a switch statement must evaluate to avalue that can bepromoted to an int value.
-
What modifiers may be used with an interface declaration
An interface may be declared as public or abstract.
-
Is a class a subclass of itself
A class is a subclass of itself.
-
What is the highest-level event class of the event-delegation model
The java.util.EventObject class is the highest-level class in the event-delegation classhierarchy.
-
What event results from the clicking of a button
The ActionEvent event is generated as the result of the clicking of a button.
-
What is the difference between a while statement and a do statement
A while statement checks at the beginning of a loop to see whether the next loop iterationshould occur. Ado statement checks at the end of a loop to see whether the next iteration of a loop shouldoccur. The dostatement will always execute the body of a loop at least once.
-
What is the Collection interface
The Collection interface provides support for the implementation of a mathematical bag -an unorderedcollection of objects that may contain duplicates.
-
What modifiers can be used with a local inner class
A local inner class may be final or abstract.
-
What is the difference between the paint() and repaint() methods
The paint() method supports painting via a Graphics object. The repaint() method is usedto cause paint() tobe invoked by the AWT painting thread.
-
What is the purpose of the File class
The File class is used to create objects that provide access to the files and directories of alocal file system.
-
Can an exception be rethrown
Yes, an exception can be rethrown.
-
Which Math method is used to calculate the absolute value of a number
The abs() method is used to calculate absolute values.
-
When is the finally clause of a try-catch-finally statement executed
The finally clause of the try-catch-finally statement is always executed unless the threadof executionterminates or an exception occurs within the execution of the finally clause.
Java Interview Questions
Ans