Given:
class Main {/*from w w w . jav a 2 s . co m*/ } abstract class MyClass { Main m() { return n(); } abstract Main n(); }
Which design pattern or principle is implemented?
B is correct.
Class Main is the object we are creating using the factory method.
Class MyClass is the abstract superclass for the factory.
Not shown is a class implementing class MyClass that actually creates the object.