Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In the following code there are three patters used, one of them is the Singleton, please name the other two patterns and for each pattern
In the following code there are three patters used, one of them is the Singleton, please name the other two patterns and for each pattern mention the name of class and its role in that pattern public interface A{ public B al(); public interface B{ public class Bar public interface public void implements Foo { Foo { b1(Foo f); public void public void foo10% foo1(); } public void b2(); System.out.println(""); } } public class DA implements A{ private static DA variable1 = new DA(); private DAO) { } private static DA deadbeef1() { public class EB implements B{ private ArrayList list1 = new ArrayList(); public void b1(Foo f){ list1.add(f); } public void b20 { for (Foo f: list1) { return variable1; } public B a1() { return new EB(); } f.foo1(); } } } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started