recategorized
10,103 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

2.3k
views
6 answers
0 votes
go_editor asked Mar 24, 2020
2,316 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); } ... } }What does this program print?$59$ $95$ $69$ $99$
3.0k
views
3 answers
0 votes
go_editor asked Jan 31, 2017
3,012 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 ( ... [4]=20; System.out.println(array[4]+":"+q[4]);20:2018:1818:2020:18
4.2k
views
4 answers
0 votes
go_editor asked Mar 24, 2020
4,208 views
Abstraction and encapsulation are fundamental principles that underlie the object oriented approach to software development. What can you say about the following two ... correctBoth I and II are correctOnly II is correctOnly I is correct
3.4k
views
1 answers
2 votes
go_editor asked Aug 20, 2016
3,384 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 ... illegal to assign one object reference variable to another object reference variable