Question: 1 public class Activity1A 2e public static void main(Stringl] args)t Item bolt = new Item(machine bolt, 50, M50-H, 129); 4. System.out.println(bolt); bolt. sell1(50); bolt.order (20);
1 public class Activity1A 2e public static void main(Stringl] args)t Item bolt = new Item("machine bolt", 50, "M50-H", 129); 4. System.out.println(bolt); bolt. sell1(50); bolt.order (20); System.out.println(bolt); 6 7 8 9 10 System.out.println("InEnd of processing-"): 12 13 14 class Item f 15private String name; 16 private int size; 17 private String code; 18 private int quantity; 19 200 public Item(String name, int size, String code, int quantity) f 21 this.name -name ; this.size size; this.code code; this.quantity quantity; 23 24 25 26 27e public void sell(int amount) [ 28 29 30 31 public void order (int amount) f 32 quantity amount; quantity += amount; 35 public String tostring) f 36 37 38 39 40 return "Item '" + name + ", size=" + size + "mm code-'" + code + quantity-" + quantity
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
