1.

Consider public class MyClass{ public MyClass(){/*code*/} // more code... } To instantiate MyClass, you would write?

A. MyClass mc = new MyClass();
B. MyClass mc = MyClass();
C. MyClass mc = MyClass;
D. MyClass mc = new MyClass; 7. E. It can't be done. The constructor of MyClass should be defined as public void MyClass(){/*code*/}
Answer» B. MyClass mc = MyClass();


Discussion

No Comment Found