Set - 2

Question 6 :

Name Component subclasses that support painting ?

Answer :

The Canvas, Frame, Panel, and Applet classes support painting.

Question 7 :

What is a native method?

Answer :

A native method is a method that is implemented in a language other than Java.

Question 8 :

How can you write a loop indefinitely?

Answer :

for(;;)--for loop; while(true)--always true, etc.

Question 9 :

Can an anonymous class be declared as implementing an interface and extending a class?

Answer :

An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.

Question 10 :

What is the purpose of finalization?

Answer :

The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.