answersLogoWhite

0


Best Answer

Abstract Class:

The class which contains the common features of components of several classes, but cannot it be instantiated by itself. It represents an abstract concept for which there is no actual existing expression. For instance, "Vegetation" is an abstract class - there is no such real, real thing as generic vegetation. Instead, there are only instances of vegetation, such as mango tree and rose plant, which are types of vegetation, and share common characteristics, such as having leaves and stem in at least part of the lifecycle.

SO in software engineering, an abstract class is a class in a nominative type system which is declared by the programmer, and which has the property that it contains members which are also members of some declared subtype. In many object oriented programming languages, abstract classes are known as abstract base classes, interfaces, traits, mixins, flavors, or roles. Note that these names refer to different language constructs which are (or may be) used to implement abstract types.

We can also say that abstract class is : -- A class which is used only as an ancestor and is never instantiated.

In other word a concrete definition will say that

A type of class with pure virtual member functions and one or more methods that are declared but not implemented, that behaves as a base class but prohibits the instantiation of any members of that class. i.e. It has a complete interface but only a partial implementation It is used to take advantage of inheritance yet prohibiting the generation of objects that are not completely defined. Concrete subclasses of an abstract class are required to flesh out the implementation by overriding the abstract methods.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the purpose of declaring abstract method?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the features and purpose of an abstract method?

abstract means nothing to implement its responsible of implementation its implementation class


Differences between declaring a method and calling a method?

Declaring a method is when you code for what the method will perform. When you call a method, you are using the method you have written in another part of the program, (or inside the method if it is recursive).


What is abstract methods?

Simply, Abstract method is a method that is declared without or containing no implementation. It has a method signature


How do you write concrete method inside abstract class?

There is no difference with method declaration and implementation between abstract and non-abstract classes. You do the exact same thing when writing a concrete method in either an abstract or non-abstract class.


What is an abstract for a scientific experiment?

An abstract for a science experiment is a short paragraph that summarizes the purpose of the experiment (including the hypothesis), the method used to perform it, the results and the conclusions. (see related link)


How do you create a concrete method inside abstract class?

The same way you create a concrete method in a concrete class. When a class is abstract, it can contain abstract methods. That doesn't mean that all methods must be abstract. Hope this helps.


Is the word method an abstract noun?

Yes, the noun method is an abstract noun, a word for a concept.


When do you declare a method or class abstract in java?

when overriding of a class or a method is necessary, they can be declared as abstract


What is the purpose for an abstract?

The purpose of an abstract is to give the reader a synopsis of what they are about to read. The abstract generally provides the details of the research including how the research was conducted.


What is concrete class in java?

A method which is not abstract i.e. if a methods definition is given in the same class its declared is called concrete. where as abstract method would have no definition till the deep down of the hierarchy of class structure but ll ve a declaration in all the subclasses and definition in one subclass after which it need not be declared in the further subclasses. By the way defining the abstract method in a subclass would end the carrying of the declaration till down, but defining it is not mandatory where declaring is mandatory.


Is Interface is a kind of abstract method?

No


Can you call an abstract method from a non abstract method in java?

We can't call (i.e, execute) an abstract method in java because these methods don't contain any code to execute!In some special cases like when an abstract method is overridden in a subclass, and when we are using super class reference variable( which is referring that subclass object), it appears that we are calling abstract method in super class. But actually the code in the subclass method is being executed.Example:abstract class SuperClass{abstract void show(); //abstract method in super class}class SubClass extends SuperClass{void show(){ //show() of SuperClass overridden in SubClassSystem.out.println("SubClass Method");}}class Example{public static void main(String... args){SuperClass sup=new SubClass();sup.show(); //SubClass show() will be executed !!!}}