Suppose A is an abstract class, B is a concrete subclass of A, and both A and B have a no-arg constructor. Which of the following is correct?
a. A a = new A();
b. A a = new B();
c. B b = new A();
d. B b = new B();
bd Since B is a concrete class with a no-arg constructor, d is correct. Since an instance of B is also an instance of A, b is also correct.
You might also like to view...
Declare a stack template container to hold values of type double using the list container. Write the necessary include and using statements. Mention any appropriate cautions about syntax.
What will be an ideal response?
Place the following steps in the cryptographic key management life cycle in the correct order
Key change Key establishment Key revocation Key destruction
Facility costs refer to the space used by the help desk personnel when they assist customers
Indicate whether the statement is true or false
The code below establishes a button labeled ____.
A. button B. button value C. Apply Style D. none of the above