Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- **********************************************
- step -1
- package OOP.InheritanceMultiple;
- public interface A {
- public abstract void play();
- }
- **********************************************
- step 2
- package OOP.InheritanceMultiple;
- public interface B {
- public abstract void play();
- }
- **********************************************
- step 3
- package OOP.InheritanceMultiple;
- public class C implements A,B {
- public void play(){
- //implemention dite hobe must be akta
- System.out.println("Hello I am User from C class ");
- }
- }
- **********************************************
- step 4
- package OOP.InheritanceMultiple;
- public class D implements A,B {
- @Override
- public void play() {
- System.out.println("Hello i am user form D class");
- }
- }
- **********************************************
- step 5
- package OOP.InheritanceMultiple;
- public class TestMain {
- public static void main(String args[]){
- C c = new C();
- c.play();
- D d = new D();
- d.play();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement