Question: Java Consider the following class declaration: public abstract class MyClass { private int x; private int y; public MyClass() { ... } // default constructor
Java
Consider the following class declaration:
public abstract class MyClass { private int x; private int y;
public MyClass() { ... } // default constructor ... }
Which of the following statements about MyClass is true?
A. The statement MyClass obj = new MyClass(); will create an instance of MyClass.
B. A program that uses MyClass must have at least one class that is a concrete subclass of MyClass.
C. More than one instance of MyClass can be created in a client program.
D. An abstract class cannot have instance variables.
E. MyClass must have a parameterized constructor to initialize x and y.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
