Test Preparation on JAVA- Test Prep.- Classes and Methods-1

1.

What is the stored in the object obj in following lines of Java code?

   box obj;

Explanation: Memory is allocated to an object using new operator. box obj; just declares a reference to object, no memory is allocated to it hence it points to NULL.

Next Question Show Answer