recategorized
9,669 views
0 votes
0 votes

Which of the following statement(s) with regard to an abstract class in JAVA is /are TRUE ?

  1. An abstract class is one that is not used to create objects
  2. An abstract class is designed only to act as a base class to be inherited by other classes
  1. Only I   
  2.  only II 
  3. Neither I  nor II
  4. Both I and II
recategorized

3 Answers

1 votes
1 votes

class that is declared as abstract is known as abstract class. It needs to be extended and its method implemented. It cannot be instantiated.

An abstract class is designed only to act as a base class to be inherited by other classes.It is a design concept in program development and provides a base upon which other classes can be built

so ans is 4

1 votes
1 votes

A class that is declared as abstract is known as abstract class. It needs to be extended and its method implemented. It cannot be instantiated.

hence answer is D ) both statements are true

0 votes
0 votes

correct answer is 4

Abstract Class

A class which contains the abstract keyword in its declaration is known as abstract class.

Abstract classes may or may not contain abstract methods, i.e., methods without body ( public void get(); )

But, if a class has at least one abstract method, then the class must be declared abstract

we can not create object for abstract class      reason : why ?

abstract class  is designed only to act as a base class to be inherited by other classes.

--------------------------------------------------------------------------------------------------------------------------------------------------

more information 

  • If you inherit an abstract class, you have to provide implementations to all the abstract methods in it

 

Answer:

Related questions