阅读背景:

当具体对象采用不同的构造函数参数时,Java中的工厂

来源:互联网 

I'm trying to implement a Factory pattern in Java. I have a class called Shape which Circle and Triangle extends. The problem is that Shape constructor gets only 2 parameters while Circle gets 3 parameters and so is Triangle (which I won't show in the code section because is identical to Circle). To demonstrate it better:I'm trying to implement a Factory pattern in Ja




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: