Given:
public abstract class Wow {
private int wow;
public Wow (int wow) {
this.wow = wow;
}
public void wow () {}
private void wowza () {}
}
What is true about the class Wow?
A.
It compiles without error.
B.
It does not compile because an abstract class cannot have private methods.
C.
It does not compile because an abstract class cannot have instance variables.
D.
It does not compile because an abstract class must have at least one abstract method.
E.
It does not compile because an abstract class must have a constructor with no arguments.
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.
A
The Answer is A.
An abstract class can contain abstract and non-abstract methods. However, an abstract method must be contained within an abstract class.
An abstract class can have private methods as long as they are not declared abstract.
An abstract class can have instance variables.
An abstract class does not have to have at least one abstract method.
An abstract class does not have to have a constructor without arguments.