Suppose A is an interface, B is a concrete class with a no-arg constructor that implements A. 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.

Computer Science & Information Technology

You might also like to view...

The risk treatment strategy that attempts to shift risk to other assets, other processes, or other organizations is known as thedefenserisk treatment strategy. __________

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

What is a “tail” in a linked list?

a. It is the last node in a data structure (which doesn't point to “next”) b. It is the node with the lowest value in the list c. It is the node with the highest value in the list d. It is the first node in a data structure

Computer Science & Information Technology