Set - 6

Question 1 :

Which class should you use to obtain design information about an object?

Answer :

The Class class is used to obtain information about an object's design.

Question 2 :

What is the relationship between clipping and repainting?

Answer :

When a window is repainted by the AWT painting thread, it sets the clipping regions to the area of the window that requires repainting.

Question 3 :

Is "abc" a primitive value?

Answer :

The String literal "abc" is not a primitive value. It is a String object.

Question 4 :

What is the relationship between an event-listener interface and an event-adapter class?

Answer :

An event-listener interface defines the methods that must be implemented by an event handler for a particular kind of event. An event adapter provides a default implementation of an event-listener interface.

Question 5 :

What restrictions are placed on the values of each case of a switch statement?

Answer :

During compilation, the values of each case of a switch statement must evaluate to a value that can be promoted to an int value.