java - I don't understand the int in the error message -
possible duplicate:
i error when try compile java code below: not sure compile can help? don't understand int in error message.
i still getting error message when try compile java code below:
//author: donna gary //date: april 10, 2011 //class: it/215 week 5 inventory program 1
import java.text.numberformat; import java.util.locale; import java.util.scanner;
class television {
private string itemnumber; private string productname; private double units; private double unitprice; private double unitstotal; //constructor public television (string itemnumber, string productname, double units, double unitprice, double unitstotal) { setitemnumber(itemnumber); setproductname(productname); setunits(units); setunitprice(unitprice); unitstotal = units ++; } //accessor methods class variables public string getitemnumber () { return itemnumber; } public void setitemnumber (string itemnumber) { this.itemnumber = itemnumber; } public string getproductname () { return productname; } public void setproductname (string productname) { this.productname = productname; } public double getunits () { return units; } public void setunits (double units) { this.units = units; } public double getunitprice () { return unitprice; } public void setunitprice (double unitprice) { this.unitprice = units * unitprice; } public double getunitstotal () { return unitstotal; } public void setunitstotal (double unitstotal) { this.unitstotal = units ++; } } public class inventorypart1 {
public static void main (string args[]) { int units; double unitprice; double unitstotal; unitstotal = units ++; double unitsprice; unitsprice = units * unitprice; double unitstotalprice; unitstotalprice = unitstotal * unitprice; double totalinventory; totalinventory = unitstotal * unitstotalprice; numberformat nf = numberformat. getcurrencyinstance(locale.us); //create instance of television class television samsung = new television ("samsung 46 6400 series”,” samsung smart tv”, “un46d6400uf"); //use methods class television output inventory details. system.out.println("item number: " + samsung.getitemnumber()); system.out.println("product name: " + samsung.getproductname()); system.out.print("number of units: "); system.out.println(nf.format(units)); system.out.print("unit price: "); system.out.println(nf.format(unitprice)); system.out.print("units total: "); system.out.println(nf.format(unitstotal)); system.out.print("units total price: "); system.out.println(nf.format(unitstotalprice)); system.out.print("total inventory: "); system.out.println(nf.format(totalinventory)); } }
i don't understand int in error message. .
c:\\documents , settings\adminuser\my documents\inventorypart1.java:96: cannot find symbol symbol : constructor television(java.lang.string) location: class television television samsung = new television("samsung 46 6400 series","samsung smarttv", "un46d6400uf"); ^ 1 error tool completed exit code 1
it's error code indicating compiler returned error.
the real problem compiler doesn't think constructor television(java.lang.string) exists. either need fix call constructor, fix constructor, or add new constructor matching call.
Comments
Post a Comment