16.3k views
5 votes
What is an abstract class? (Points : 2) A generalized class used only to create related derived classes

A class without any superclasses
A class from which we create many instances
Any subclass with more than one superclass

1 Answer

2 votes

Answer:

A generalized class used only to create related derived classes

Step-by-step explanation:

An abstract class is a class which cannot be instantiated on its own. It is defined using an abstract keyword. However, an abstract class can be inherited from and the derived class can actually be instantiated. For example:

abstract class A{

}

class B extends A{

void test(){

}

}

Here class A is an abstract class, while class B inherits from A. Now we can create an instance of class B as follows:

B b = new B();

b.test();

User Elliot Gorokhovsky
by
5.4k points