answersLogoWhite

0


Best Answer

Abstract classes are to be extended until to a concrete class.

Can have both abstract & non abstract methods.

An Abstract class can not be instantiated.

A non abstract class can be extended to an abstract class.

If At least one abstract method present in a class then that class must be abstract.

abstract & final modifiers can never be together.

abstract classes can have both abstract methods & non abstract methods.

User Avatar

Wiki User

โˆ™ 2009-10-20 06:35:48
This answer is:
User Avatar
Study guides

Physics

22 cards

Why are there no machines with 100 percent efficiency

What kind of friction must be overcome to start movement of a stationary object

The number of protons in an atom determines the atom's what

Why are wheels useful for moving heavy objects

โžก๏ธ
See all cards
5.0
โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…
1 Review

Add your answer:

Earn +20 pts
Q: What can be declared in an abstract class?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Abstract class can be private?

A class can either be default or public it can never be declared as private, so the question of abstract class at the file level does not arise. But an inner class can be declared private and abstract as well.


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 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.


Why do you use abstract classes in java?

Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie, you may not call its constructor), abstract class may contain static data. Any class with an abstract method is automatically abstract itself, and must be declared as such. A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated.


What happens if an abstract modifier is applied to class. Explain?

The classes which have one or more abstract methods are abstract. To declare a class as abstract, use the abstract keyword in front of the class keyword, before the class declaration. Abstract classes cannot be instantiated. Similarly the new keyword cannot be used to create an object of the abstract class. Remember that the constructors and static variables cannot be declared as abstract. Any subclass of an abstract class must either implement all of the abstract methods in the superclass or be itself declared abstract.


What are abstract method in java?

An abstract method is a method that is declared without an implementation (without braces, and followed by a semicolon), like this: abstract void add(double X, double Y);If a class includes abstract methods, the class itself must be declared abstract


When an interface method is implemented in a class it must be declared as?

Abstract type


What are the differences between class and abstract class?

Normal variables or static variables are declared and use in class but abstract class had only static variables. You have declare and define the methods in class. But abstract class only allow for method declaration only. The abstract class like interface.


What is difference between an overridden method and an abstract method?

An overridden method is one which has already been implemented in the parent class with the same signature but has again been coded in the current class for functionality requirements. An abstract method is one which has only been declared in a class and would have to be implemented by the class that extends this abstract class. The implementation for the method is not available in the class in which it is declared.


What is abstract calss?

An Abstract class is a special kind of class that cannot be instantiated. It has one or more methods which are not implemented in the class. These methods are declared abstract and they do not contain any code inside them. Ex: abstract class Parent { public abstract String getSon(); public abstract String getDaughter(); .... .... //More methods that contain specific behaviour/code in them } The above is an abstract class "Parent" that has a lot of functionality but it has declared two abstract methods which have no code inside them. Any class that has one or more abstract methods has to be abstract. This abstract class cannot be instantiated. i.e., the below piece of code will not work. The code will not even compile. Parent object = new Parent();


What is difference between Abstract Class and Interface?

All the methods declared inside an Interface are abstract. Where as abstract class must have at least one abstract method and others may be concrete or abstract. In Interface we need not use the keyword abstract for the methods.


When an abstract modifier applied to a class?

An Abstract class is a special kind of class that cannot be instantiated. It has one or more methods which are not implemented in the class. These methods are declared abstract and they do not contain any code inside them. Ex: abstract class Parent { public abstract String getSon(); public abstract String getDaughter(); .... .... //More methods that contain specific behaviour/code in them } The above is an abstract class "Parent" that has a lot of functionality but it has declared two abstract methods which have no code inside them. Any class that has one or more abstract methods has to be abstract. This abstract class cannot be instantiated. i.e., the below piece of code will not work. The code will not even compile. Parent object = new Parent();

People also asked