public interface PhoneFactory {
EarPhone createEarPhone();
Screen createScreen();
}
public class AppleFactory implements PhoneFactory{
@Override public EarPhone createEarPhone() {
return new LightingPointEar();
}
@Override public Screen createScreen() {
return new FourPointSevenScreen();
}
}
public class SamsungFactory implements PhoneFactory {
@Override public EarPhone createEarPhone() {
return new ThreePointFiveEar();
}
@Override public Screen createScreen() {
return new FivePointFiveScreen();
}
}