• recategorized
11,545 views
0 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

3 Answers

1 1 vote

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.

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 1 vote

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 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:
Position:
Show:

Related questions

0 0 votes
6 6 answers
4.1k
4.1k views
go_editor asked Mar 24, 2020
4,148 views
Consider the following JAVA program:public class First { public static int CBSE (int x) { if (x < 100)x = CBSE (x+10); return (x-1); } public ...
0 0 votes
3 answers 3 answers
3.7k
3.7k views
go_editor asked Jan 31, 2017
3,688 views
Given the array of integers ‘array’ shown below:1372721833911228What is the output of the following JAVA statements?int[] p = new int [10]; int[] q = new int [10]; for (i...
0 0 votes
4 4 answers
5.6k
5.6k views
go_editor asked Mar 24, 2020
5,570 views
Abstraction and encapsulation are fundamental principles that underlie the object oriented approach to software development. What can you say about the following two stat...
2 2 votes
1 1 answer
4.2k
4.2k views
go_editor asked Aug 20, 2016
4,195 views
When one object reference variable is assigned to another object reference variable thena copy of the object is createda copy of the reference is createda copy of the ref...