Which of the following statements are true?
1) If a class has any abstract methods it must be declared abstract itself.
2) All methods in an abstract class must be declared as abstract
3) When applied to a class, the final modifier means it cannot be sub-classed
4) transient and volatile are Java modifiers
Answer :
1) If a class has any abstract methods it must be declared abstract itself.
3) The final modifier means that a class cannot be sub-classed
4) transient and volatile are Java modifiers
An abstract class may have non abstract methods. Any class that descends from an abstract class must implement the abstract methods of the base class or declare them as abstract itself.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment