// A prototype to create a factory class
package edu.training.designpatterns;
class Factory {
//
constructors cannot be overridden &
//
constructors are called only once during the life cycle of an object
private Factory() {
}
public static Factory
getObject() {
Factory
a = new Factory();
return a;
}
}
No comments:
Post a Comment