Set - 5

Question 41 :

What are the high-level thread states?

Answer :

The high-level thread states are ready, running, waiting, and dead.


Question 42 :

What value does read() return when it has reached the end of a file?

Answer :

The read() method returns -1 when it has reached the end of a file.


Question 43 :

Can a Byte object be cast to a double value?

Answer :

No, an object cannot be cast to a primitive value.


Question 44 :

What is the difference between a static and a non-static inner class?

Answer :

A non-static inner class may have object instances that are associated with instances of the class's outer class. A static inner class does not have any object instances.


Question 45 :

What is the difference between the String and StringBuffer classes?

Answer :

String objects are constants. StringBuffer objects are not.