Given:
public class MyClass{ String name; public MyClass (){ } }
Which of the following lines creates an MyClass instance?
Select 1 option
Correct Option is : B
For Option A.
This declares a variable of class MyClass but does not create any object.
For Option B.
Using the new operator is the right way to create an object.