Set - 10

Question 11 :

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.


Question 12 :

What is the Locale class?

Answer :

The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region.


Question 13 :

What is the difference between a while statement and a do statement?

Answer :

A while statement checks at the beginning of a loop to see whether the next loop iteration should occur. A do statement checks at the end of a loop to see whether the next iteration of a loop should occur. The do statement will always execute the body of a loop at least once.


Question 14 :

What is the difference between static and non-static variables?

Answer :

A static variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on unique values with each object instance.


Question 15 :

How are this() and super() used with constructors?

Answer :

This() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.