Arnab_Manna

abstraction2

Nov 27th, 2021
737
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //A simple abstruct class
  2. abstract class A{
  3.     abstract void callme();
  4.     void callmetoo(){
  5.         System.out.println("this is an concrete method.");
  6.     }
  7. }
  8.  
  9. class B extends A{
  10.     void callme(){
  11.         System.out.println("B's implementaton of callme .");
  12.     }
  13. }
  14.  
  15. class AbsractDemo{
  16.         public static void main(String agrs[]){
  17.             A b=new B();
  18.            
  19.             b.callme();
  20.             b.callmetoo();
  21.         }
  22. }
  23.  
RAW Paste Data