This Work Is Licensed Under A - This Presentation Is Released Under Creative Commons
This Work Is Licensed Under A - This Presentation Is Released Under Creative Commons
• The final keyword in java is used to restrict the user. The java final
keyword can be used in many context. Final can be:
• variable
• method
• Class
Abstract method
• A method that is declared as abstract and does not have implementation is
known as abstract method.Example abstract method
• abstract void printStatus();//no body and abstract
• (Source: https://www.javatpoint.com)
Example of abstract class that has abstract
method
abstract class Bike{
abstract void run();
}
class Honda4 extends Bike{
void run(){System.out.println("running safely..");}
public static void main(String args[]){
Bike obj = new Honda4();
obj.run();
}
}
Output: running safely..