Java Interview question 5
Q: When a thread is created and started, what is its initial state? A: A thread is in the ready state after it has been created and started. Q: What is the purpose of finalization? A: The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected. Q: What is the Locale class? A: The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region. Q: What is the difference between a while statement and a do statement? A: 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. Q: What is the difference between static and non-static variables? A: A static variable is associated with the class as a whole rather than with specific