A valid reason to declare a class as abstract is to:

A valid reason to declare a class as abstract is to:

A valid reason to declare a class as abstract is to:

A.
define methods within a parent class, which may not be overridden in a child class

B.
define common method signatures in a class, while forcing child classes to contain unique
methodimplementations

C.
prevent instance variables from being accessed

D.
prevent a class from being extended

E.
define a class that prevents variable state from being stored when object Instances are
serialized

F.
define a class with methods that cannot be concurrently called by multiple threads

Explanation:

Note:An abstract method in Java is something like a pure virtual function in C++ (i.e., a
virtualfunction that is declared = 0). In C++, a class that contains a pure virtual function is called an
abstract classand cannot be instantiated. The same is true of Java classes that contain abstract
methods.
Any class with an abstract method is automatically abstract itself and must be declared as such.
An abstract class cannot be instantiated.
A subclass of an abstract class can be instantiated only if it overrides each of the abstract
methods of itssuperclass and provides an implementation (i.e., a method body) for all of them.
Such a class is often called aconcrete subclass, to emphasize the fact that it is not abstract.
If a subclass of an abstract class does not implement all the abstract methods it inherits, that
subclass is itselfabstract.static, private, and final methods cannot be abstract, since these types of
methods cannot be overridden by asubclass. Similarly, a final class cannot contain any abstract
methods.
A class can be declared abstract even if it does not actually have any abstract methods. Declaring
such a classabstract indicates that the implementation is somehow incomplete and is meant to
serve as a superclass forone or more subclasses that will complete the implementation. Such a
class cannot be instantiated.



Leave a Reply 1

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