Instantiating a reference type

suggest change
Object obj = new Object(); // Note the 'new' keyword

Where:

What happens:


This is different from primitives:

int i = 10;

Where the actual value 10 is stored in i.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents