Question: Which Pattern is used in the following code? ( check one ) class MyClass 1 { public void bar ( double lba, int size )

Which Pattern is used in the following code? (check one) class MyClass1{ public void bar(double lba, int size){ System.out.print(lba + size); }} class MyClass2{ public void foo(double lba, int size){ System.out.print(lba * size); }} class MyClass3{ private MyClass1 o1; private MyClass2 o2; public MyClass3(){ this.o1= new MyClass1(); this.o2= new MyClass2(); } public void doIt(double lba, int size){ o1.bar(lba, size); o2.foo(lba, size); }} public class TestRun { public static void main(String[] args){ MyClass3 c = new MyClass3(); c.doIt(3,3); }} Command Pattern State Pattern Facade Pattern Composite Pattern Template Pattern Decorator Pattern Adapter Pattern Observer Pattern

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!