answersLogoWhite

0


Best Answer

Abstract keyword used for method declaration declares the methods without implementations.

Abstract class in java have abstract methods that is not implemented in abstract class, but implemented in subclasses in java program. If the class in java program is not required to get instantiated than that class use the abstract keyword but this class rather is available for other classes to extend by other classes.

Abstract keyword will be used in method declaration to declare that method without providing the implementation in that java program. In other words we can say that, it formally unfinished class as well as method, that marked with the help of keyword abstract.

Defining abstract is a way of preventing someone from instantiating a class that is supposed to be extended first. In java program abstract class is deliberately missing similar to like an interface which will missing all method bodies in the program. Abstract class provides a way to extend an actual class. We will not use new on abstract classes but will use abstract references in the java program, that always point to objects of the class that extends an abstract class.

In java program for practical use of an abstract class, we will define a non-abstract class that extends an abstract one. This will use any of the inherited non-abstract methods.

Most of the time abstract class may extend another abstract class. In that condition it need not implement all in the non-abstract methods. An abstract keyword used both on classes and methods. In case of class declared with an abstract keyword may not be instantiated that is the only thing that abstract keyword doing.

User Avatar

Wiki User

โˆ™ 2009-04-26 06:31:21
This answer is:
User Avatar
Study guides

Mixture

1 card

Class

โžก๏ธ
See all cards
4.35
โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…
23 Reviews

Add your answer:

Earn +20 pts
Q: What is purpose of An Abstract Class in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is abstract class in Java?

a abstract class is class which has a abstract method which means a method does not its own body.


What are abstract class in java?

An abstract class is just like any other class in java just with a little difference; at least one of his methods is not implemented (a abstract method). For this reason abstract classes can not be instantiated (create a sample of this class), and his unique purpose is to be inherited an implemented by others classes. This is a sample of a abstract class: public abstract class MyAbstract{ public void normalMethod(){//Do something} public abstract void abstractMethod(); }


What is purpose of creating an abstract class in java?

Abstract classes are generally used where you want an amount of behaviour to be used by the class that extends the abstract class while at the same time giving options to the child class to provide a certain amount of behaviour itself.


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


Abstract keyword in java?

Abstract keywordused for method declaration declares the methods without implementations. Abstract class in java have abstract methods that is not implemented in abstract class, but implemented in subclasses in java program. If the class in java program is not required to get instantiated than that class use the abstract keyword but this class rather is available for other classes to extend by other classes. Abstract keyword will be used in method declaration to declare that method without providing the implementation in that java program. In other words we can say that, it formally unfinished class as well as method, that marked with the help of keyword abstract. Defining abstract is a way of preventing someone from instantiating a class that is supposed to be extended first. In java program abstract class is deliberately missing similar to like an interface which will missing all method bodies in the program. Abstract class provides a way to extend an actual class. We will not use new on abstract classes but will use abstract references in the java program, that always point to objects of the class that extends an abstract class. In java program for practical use of an abstract class, we will define a non-abstract class that extends an abstract one. This will use any of the inherited non-abstract methods. Most of the time abstract class may extend another abstract class. In that condition it need not implement all in the non-abstract methods. An abstract keyword used both on classes and methods. In case of class declared with an abstract keyword may not be instantiated that is the only thing that abstract keyword doing.

Related questions

What is abstract class in Java?

a abstract class is class which has a abstract method which means a method does not its own body.


What are abstract class in java?

An abstract class is just like any other class in java just with a little difference; at least one of his methods is not implemented (a abstract method). For this reason abstract classes can not be instantiated (create a sample of this class), and his unique purpose is to be inherited an implemented by others classes. This is a sample of a abstract class: public abstract class MyAbstract{ public void normalMethod(){//Do something} public abstract void abstractMethod(); }


What is purpose of creating an abstract class in java?

Abstract classes are generally used where you want an amount of behaviour to be used by the class that extends the abstract class while at the same time giving options to the child class to provide a certain amount of behaviour itself.


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


Abstract keyword in java?

Abstract keywordused for method declaration declares the methods without implementations. Abstract class in java have abstract methods that is not implemented in abstract class, but implemented in subclasses in java program. If the class in java program is not required to get instantiated than that class use the abstract keyword but this class rather is available for other classes to extend by other classes. Abstract keyword will be used in method declaration to declare that method without providing the implementation in that java program. In other words we can say that, it formally unfinished class as well as method, that marked with the help of keyword abstract. Defining abstract is a way of preventing someone from instantiating a class that is supposed to be extended first. In java program abstract class is deliberately missing similar to like an interface which will missing all method bodies in the program. Abstract class provides a way to extend an actual class. We will not use new on abstract classes but will use abstract references in the java program, that always point to objects of the class that extends an abstract class. In java program for practical use of an abstract class, we will define a non-abstract class that extends an abstract one. This will use any of the inherited non-abstract methods. Most of the time abstract class may extend another abstract class. In that condition it need not implement all in the non-abstract methods. An abstract keyword used both on classes and methods. In case of class declared with an abstract keyword may not be instantiated that is the only thing that abstract keyword doing.


Are all java stream class an abstract?

yes


Does abstract class contain the definition of non abstract method in java?

yes,abstract class can have non abstract methods,even it can have all non abstract method


How do you make a class in Java abstract?

By using the abstract keyword in the class declaration line. Ex: public abstract ClassName {} The Java compiler will force you to use the abstract keyword in the class declaration line if one or more methods in your class are abstract (no implementation) or if you have not provided implementations for one or more methods of an interface that you are implementing in your class definition. You cannot instantiate an abstract class.


Abstract in java?

An abstract in java is used to specify that the class/function is not yet complete. When a class in declared as abstract it means that it is not meant to be instantiated (you can't create variables of that type). This is because they are meant to be more of a guideline for other classes. When a class extends an abstract class it must either define all of the abstract methods from the abstract class or it must also be declared as an abstract class itself.


How do you call the abstract class constructor to base class in java?

An abstract class cannot have a constructor and hence you cannot invoke the constructor of the class - i.e., you can instantiate an abstract class and hence you cannot call the constructor of an abstract class.


What is the different between Abstract and a base class in java?

An abstract class(or classes) can't have a constructor and hence you cannot invoke the constructor of the class (for example, you can instantiate an abstract class and hence you cannot call the constructor of an abstract class).


What is the meaning of abstract in java?

The keyword abstract is used to signify a class which does not offer the method definition for one or more methods in the class. A fully abstract class is equivalent to an interface.

People also asked