Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface InterfaceA{
- void functionA();
- }
- interface InterfaceB{
- void functionB();
- }
- class A implements InterfaceA{
- @override
- void functionA(){
- System.out.println("classA: functionA");
- }
- }
- class B implements InterfaceB{
- @override
- void functionB(){
- System.out.println("classB: functionB");
- }
- }
- class Test implements InterfaceA, InterfaceB {
- InterfaceA instanceA;
- InterfaceB instanceB;
- Test(InterfaceA interfaceA, InterfaceB interfaceB){
- instanceA = interfaceA;
- instanceB = interfaceB;
- }
- @override
- void functionA(){
- instanceA.functionA();
- }
- @override
- void functionB(){
- instanceB.functionB();
- }
- }
Add Comment
Please, Sign In to add comment