What is true about the class Wow?

Given: What is true about the class Wow?

Given: What is true about the class Wow?

A.
It does not compile because an abstract class cannot have instance variables.

B.
It does not compile because an abstract class must have at least one abstract method.

C.
It compiles without error.

D.
It does not compile because an abstract class cannot have private methods.

E.
It does not compile because an abstract class must have a constructor with no
arguments.



Leave a Reply 6

Your email address will not be published. Required fields are marked *


obrain

obrain

A. It does NOT compile because an abstract class CANNOT have instance variables.
Explanation:
An abstract class is a class that is declared abstract—it may or may not
include abstract methods (not B, not D). Abstract classes cannot be instantiated, but they can be subclassed. The code compiles with a failure for line ‘public wow (int wow) {‘

nisha

nisha

Given answer is Correct. It compiles without error. Tried it.
BTW what you have mentioned is a method and a method needs a return type.
In the question it is a constructor – notice the W(caps)