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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -