Question: Assume that we have the following class declaration. public class Inventory String name: double price: public Inventory(String n double p) { this.name=n; this.price-p:) public Inventory(String
Assume that we have the following class declaration. public class Inventory String name: double price: public Inventory(String n double p) { this.name=n; this.price-p:) public Inventory(String n){ this.name=n:} } Which of the following is a correct object declaration? Inventory a-new Inventoryo: Inventory a= new Inventory Onventory a-new Inventory(12.5); O Inventory a-new Inventory("Pen")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
