/** * Creates and starts a new watch. * * @return a new watch, started with the invocation of this method. */ public static Watch start() { return new Watch(); }
public class Store { private ArrayList<Watch> watches; public Store() { watches = new ArrayList<>(); // Add first watch watches.add(new Watch(...)); } }
public void addWatches(){ String name = InputHelper.getInput("Enter name: "); String serial = InputHelper.getInput("Enter serial: "); String desc = InputHelper.getInput("Enter description: "); String color = InputHelper.getInput("Enter Color: "); String price = InputHelper.getInput("Enter price: "); String weight = InputHelper.getInput("Enter weight: "); double pr = Double.parseDouble(price); double wg = Double.parseDouble(weight); long sr = Long.parseLong(serial); Watch wt = new Watch(); wt.addWatch(name, sr, desc, color, pr, wg); // this is a method inside Watch class that is responsible for adding watch information watchStore.add(wt); }
var W = new Watch();
Watch wt = new Watch(); String name = InputHelper.getInput("Enter name: "); String serial = InputHelper.getInput("Enter serial: ");