Advertisement
Guest User

Untitled

a guest
May 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. **********************************************
  2. step -1
  3.  
  4.  
  5. package OOP.InheritanceMultiple;
  6.  
  7. public interface A {
  8.  
  9. public abstract void play();
  10. }
  11.  
  12.  
  13. **********************************************
  14. step 2
  15. package OOP.InheritanceMultiple;
  16.  
  17. public interface B {
  18.  
  19. public abstract void play();
  20. }
  21.  
  22.  
  23.  
  24. **********************************************
  25. step 3
  26.  
  27. package OOP.InheritanceMultiple;
  28.  
  29. public class C implements A,B {
  30.  
  31. public void play(){
  32.  
  33. //implemention dite hobe must be akta
  34. System.out.println("Hello I am User from C class ");
  35. }
  36. }
  37.  
  38.  
  39. **********************************************
  40. step 4
  41.  
  42. package OOP.InheritanceMultiple;
  43.  
  44. public class D implements A,B {
  45.  
  46.  
  47. @Override
  48. public void play() {
  49.  
  50. System.out.println("Hello i am user form D class");
  51. }
  52. }
  53.  
  54.  
  55.  
  56. **********************************************
  57. step 5
  58.  
  59. package OOP.InheritanceMultiple;
  60.  
  61. public class TestMain {
  62.  
  63. public static void main(String args[]){
  64.  
  65.  
  66. C c = new C();
  67. c.play();
  68.  
  69. D d = new D();
  70. d.play();
  71.  
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement