If class is declared abstract then why abstract keyword used before method in abstract class?
In abstract class we declare whole class as abstract i.e incomplete then why abstract keyword needs to declare before method?
-
Israil - 1230 Views
- 6 Answers
n emabstract class/em is aa rel='nofollow' href="https://crbtech.in/programmes/java-training-programme" class /athat is declared abstract—it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed.br /An emabstract method/em is a method that is declared without an implementation (without braces, and followed by a semicolon), like this:br /abstract void moveTo(double deltaX, double deltaY);br /If a class includes abstract methods, then the class itself emmust/em be declared abstract, as in:br /public abstract class GraphicObject { // declare fields // declare nonabstract methods abstract void draw(); }br /When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract methods in its parent class. However, if it does not, then the subclass must also be declared abstract.
-
- 27 May
- 0 Comments
- Share
Didn't get the answer.
Contact people of Talent-Core Java directly by clicking here
-
How to iterate through a text file and search records in a java program?
-
What are the best way to get more knowledge about programming
-
Why does arguments in the methods are initialized with their default value in Java?
-
How do I stop getting emails from this website?
-
In This Program uses the topic are String and StringBuffer and etc.
-
can i compile a java file using classpath and that java file is present in some other directory
-
How does Yout4Work place students based on percentile?
-
this program is not working correctly
-
Illgal argument Exception in getDeclaredConstructor
-
1 2 3 2 3 4 5 4 3 4 5 6 7 6 5 4 5 6 7 8 9 8 7 6 5