java - Parameter to be passed through a method -
java - Parameter to be passed through a method -
i'm creating constructor, i've been told is:
"the quantity
parameter passed testquantity
method."
"following phone call getprice
method should made passing productname
parameter"
this have far contructor, variables setup , need help.
public order (string productname, int quantity) { ordernum = ordernum + 1; productname = this.productname; quantity = testquantity; if (isvalidorder = true)
in case constructor should this:
public order (string productname, int quantity) { testquantity(quantity); //probably should homecoming boolean or throw exception double cost = getprice(productname); //probably should homecoming quantity. //other operations needed. }
java
Comments
Post a Comment