Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Appledevice
- {
- public Appledevice createDevice(String type, String color)
- {
- AplleDevice device = null;
- if (type.Equals("Iphone"))
- {
- if (color.Equals("White"))
- {
- device = new WhiteIphone();
- }
- if (color.Equals("Golden"))
- {
- device = new GoldenIphone();
- }
- }
- else if (type.Equals("Ipad"))
- {
- if (color.Equals("White"))
- {
- device = new WhiteIpad();
- }
- if (color.Equals("Golden"))
- {
- device = new GoldenIpad();
- }
- }
- device.verifyPrice();
- device.calculateDeliveryPrice();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement