0

Sololearn Java Abstract How the method has the int keyword

How the method has the int keyword ? Fill in the blanks to create an abstract class with an abstract method and inherit from it. abstract class Animal { public int age; public abstract int printAge(); // How the method has the int keyword ? } class Dog extends Animal { public int printAge() { return age; } }

23rd Apr 2019, 4:20 PM
S. Kaouche
S. Kaouche - avatar
1 Antwort
- 1
It is abstract method and it can be used in abstract class This method is not implemeted Key word int means that after implementation in inheritors this method must return some integer value
23rd Apr 2019, 8:50 PM
Владислав Крец
Владислав Крец - avatar