The result of x.length( ) + y.length( ) is

The result of x.length( ) + y.length( ) is

a)       0
b)       5
c)       6
d)       10
e)       a thrown exception
Answer:  e.

Explanation:  The statement y.length( ) results in a thrown NullPointException because it is not possible to pass a message to an object that is not currently instantiated (equal to null).


Enhancing Classes

Learn More Multiple Choice Question :