Set - 5

Question 51 :

When can an object reference be cast to an interface reference?

Answer :

An object reference be cast to an interface reference when the object implements the referenced interface.


Question 52 :

What is the difference between a Window and a Frame?

Answer :

The Frame class extends Window to define a main application window that can have a menu bar.


Question 53 :

Which class is extended by all other classes?

Answer :

The Object class is extended by all other classes.


Question 54 :

Can an object be garbage collected while it is still reachable?

Answer :

A reachable object cannot be garbage collected. Only unreachable objects may be garbage collected..


Question 55 :

Is the ternary operator written 

x : y ? z or x ? y : z ?

Answer :

It is written 

x ? y : z