Java- abstract modifier
the abstract is a modifier applicable for classes and methods but not for variables.
1 . abstract method:-
If we don't know about implementation even though we have to declare the method then we should go for abstract method.
In the abstract method, the only declaration is available but not the implementation that's why abstract method declaration should end with "; " semicolon.
example:-
public abstract void m1( ) ; correct
public abstract void m1( ){ } incorrect
Child class is responsible to provide implementation for parent class abstract method.
example:-
abstract class Parent
{
public abstract int salary() ;
}
class Child1 extends Parent
{
public int salary( )
{
return 70000;
}
}