Guest User

Untitled

a guest
Nov 24th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. class Example1{
  2.  
  3. public void display1(){
  4.  
  5. System.out.println("display1 method");
  6.  
  7. }
  8.  
  9. }
  10.  
  11. abstract class Example2{
  12.  
  13. public void display2(){
  14.  
  15. System.out.println("display2 method");
  16.  
  17. }
  18.  
  19. }
  20.  
  21. abstract class Example3 extends Example1{
  22.  
  23. abstract void display3();
  24.  
  25. }
  26.  
  27. class Example4 extends Example3{
  28.  
  29. public void display3(){
  30.  
  31. System.out.println("display3 method");
  32.  
  33. }
  34.  
  35. }
  36.  
  37. class Demo{
  38.  
  39. public static void main(String args[]){
  40.  
  41. Example4 obj=new Example4();
  42.  
  43. obj.display3();
  44.  
  45. }
  46. }
Add Comment
Please, Sign In to add comment