<code>Dog a = new Dog(); Dog b = new Dog();</code> — a and b are
- A
Compile error
- B
References to null
- Ccheck_circle
Two distinct objects with their own state
- D
The same object
Explanation
Each <code>new</code> creates a fresh object.
AP Computer Science A· difficulty 3/5
<code>Dog a = new Dog(); Dog b = new Dog();</code> — a and b are
Compile error
References to null
Two distinct objects with their own state
The same object
Explanation
Each <code>new</code> creates a fresh object.
Want 10 more like this — adaptive to your weak spots?