in Java recategorized by
1 vote
1 vote

Which of the following is not a correct statement ?

  1. Every class containing abstract method must be declared abstract.
  2. Abstract class can directly be initiated with ‘new’ operator.
  3. Abstract class can be initiated.
  4. Abstract class does not contain any definition of implementation.
in Java recategorized by

1 comment

answer is B

An abstract class cannot be directly instantiated with new operator.

ref :


1 Answer

1 vote
1 vote

ans should be  B it is surely not correct

In general an abstract class is used to define an implementation and is intended to be inherited from by concrete classes. It's a way of forcing a contract between the class designer and the users of that class. If we wish to create a concrete class (a class that can be instantiated) from an abstract class we must declare and define a matching member function for each abstract member function of the base class. Otherwise, if any member function of the base class is left undefined, we will create a new abstract class (this could be useful sometimes).

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true