title: Java Error: Cannot find symbol/Inventory Program
body: <p>I'm new to Java and trying to compile this inventory program. I keep getting the same error message and can't figure out what I'm missing. The error is cannot find symbol and it is on lines 10,18,20,21,22,23 anyting that says Inventory has the ^ symbol pointing at them. I am enclosing what I have racked my brains and tried everything I can and would appreciate any help with this.</p>
  
  <pre><code>//InventoryProgram2.java
  //Camera inventory program
  import java.util.Arrays; 
  
  public class InventoryProgram2
  {
  public static void main( String args [])
  {
        //instantiate camera object
        Inventory myInventory = new Inventory();
  
  
        //displays welcome message
  System.out.println( "Camera Invenotry Program");
  System.out.println();//skips a line
  
  //create and initialize an array of Cameras
  Inventory[] Camera = new Inventory[4];
  
  Camera[0] = new Inventory( 1980, "Cannon Rebel T3", 20, 489.99);
  Camera[1] = new Inventory( 2120, "Nikon CoolPix L810", 5, 279.99);
  Camera[2] = new Inventory( 1675, "Sony CyberShot HX200V", 12, 479.99);
  Camera[3] = new Inventory( 1028, "Fujifilm FinePix S4300", 3, 199.99);
  
  //for each array element, output value
  
  for(int count = 0; count &lt; Camera.length; count++)
  {
      Camera[count] = count+1;
  
      System.out.printf("Product Number: %4.2f\n", Camera[count].getprodNumber() );
      System.out.printf("Product Name: %s\n", Camera[count].getprodName() );
      System.out.printf("Units In Stock: %.2f\n", Camera[count].getunitsTotal() );
      System.out.printf("Unit Price: $%4.2f\n", Camera[count].getunitPrice() );
      System.out.printf("Inventory Value: $%4.2f\n", Camera[0].gettotalInventory() );
      System.out.println();//blank line to seperate products
  
      }//end for 
  
  }//end main method
  
  }//end public class InventoryProgram2
  
  class Camera
  {
  
  private int prodNumber;//product number
  private String prodName;//product name
        private int unitsTotal;//total units in stock
        private double unitPrice;//price per unit
  private double totalInventory;//amount of total inventory
  
  //initializa four-argument constructor
  public Camera ( int number, String name, int total, double price)
        {
       prodNumber = number;
       prodName = name;
       setUnitsTotal (total);//validate and store total of camera
       setUnitPrice (price);//validate and store price per camera
  
  }//end four-argument constructor
  
  
  public void setProdNumber (int number)
  {
            prodNumber = number;
  }
  
        public int getProdNumber()
  {
      return prodNumber;
  }
  
  public void setProdName (String name)
  {
      prodName = name;
  }
        public String getProdName()
  {
      return prodName;
  }
  
  public void setUnitsTotal (int total)
        {
      unitsTotal = total;
  }
  public int getUnitsTotal()
  {
      return unitsTotal;
  }  
        public void setUnitPrice (double price)
        {
      unitPrice = price;
  }
        public double getUnitPrice()
  {
      return unitPrice;
  }
  
  
  // method to set Inventory value
  //public void setInventoryValue(double value)
  
  //{
  //InventoryValue = value;
  //}end method setInventoryValue
  
  //method to get InventoryValue
  //public double getInventoryValue()
  //{
  // return InventoryValue;
  //} //end method to getInventoryValue
  
  public double getInventoryValue()
  {
      return unitPrice * unitsTotal;
  }//end method to getInventoryValue
  
  //method to set TotalInventory
  //public void setTotalInventory(double value)
  
  //{
  //TotalInventory = total;
  //}end method setTotalInventory
  
  //method to get TotalInventory
  //public double getTotalInventory()
  
  //{
  //return TotalInventory;
  //}end method to getTotalInventory
  
  }//end class Camera
  </code></pre>
  
  <p>I needed to keep one class camera so I did some adjustemnts. I'm down to 7 errors as follows:</p>
  
  <p>line 10: error: constructor Camera in class Camera cannot be applied to given types;
          Camera myCamera = new Camera();
      required: int,String,int,double
      found: no arguments
      reason: actual and formal argument lists differ in length</p>
  
  <p>line 29: error: incompatible types
          Inventory[count] = count+1
                                  ^
      required: Camera
      found: int</p>
  
  <p>lines 31, 32, 33, 34, 35, : error cannot find symbol
          System.out.printf(......) [count].getprodNumber
                                           ^
      symbol: method getprodNumber()
      location: class Camera</p>
  
  <p>here is my updated code:</p>
  
  <pre><code>//Inventory.java
  </code></pre>
  
  <p>//Camera inventory program
     import java.util.Arrays; </p>
  
  <pre><code>public class Inventory
  {
  public static void main( String args [])
        {
        //instantiate camera object
        Camera myCamera = new Camera();
  
  
  //displays welcome message
  System.out.println( "Camera Invenotry Program");
  System.out.println();//skips a line
  
  //create and initialize an array of Cameras
  Camera[] Inventory = new Camera[4];
  
  Inventory[0] = new Camera( 1980, "Cannon Rebel T3", 20, 489.99);
  Inventory[1] = new Camera( 2120, "Nikon CoolPix L810", 5, 279.99);
  Inventory[2] = new Camera( 1675, "Sony CyberShot HX200V", 12, 479.99);
  Inventory[3] = new Camera( 1028, "Fujifilm FinePix S4300", 3, 199.99);
  
  //for each array element, output value
  
  for(int count = 0; count &lt; Inventory.length; count++)
  {
        Inventory[count] = count+1;
  
        System.out.printf("Product Number: %4.2f\n", Inventory[count] .getprodNumber() );
        System.out.printf("Product Name: %s\n", Inventory[count] .getprodName() );
        System.out.printf("Units In Stock: %.2f\n", Inventory[count] .getunitsTotal() );
        System.out.printf("Unit Price: $%4.2f\n", Inventory[count] .getunitPrice() );
        System.out.printf("Inventory Value: $%4.2f\n", Inventory[0] .gettotalInventory() );
        System.out.println();//blank line to seperate products
  
      }//end for 
  
  }//end main method
  
  }//end public class Inventory
  
  class Camera
  {
  
  private int prodNumber;//product number
  private String prodName;//product name
        private int unitsTotal;//total units in stock
        private double unitPrice;//price per unit
  private double totalInventory;//amount of total inventory
  
  //initializa four-argument constructor
  public Camera ( int number, String name, int total, double price)
        {
       prodNumber = number;
       prodName = name;
       setUnitsTotal (total);//validate and store total of camera
       setUnitPrice (price);//validate and store price per camera
  
  }//end four-argument constructor
  
  
  public void setProdNumber (int number)
  {
      prodNumber = number;
  }
  
        public int getProdNumber()
  {
      return prodNumber;
  }
  
  public void setProdName (String name)
  {
      prodName = name;
  }
        public String getProdName()
  {
      return prodName;
  }
  
  public void setUnitsTotal (int total)
        {
      unitsTotal = total;
  }
  public int getUnitsTotal()
  {
      return unitsTotal;
  }  
        public void setUnitPrice (double price)
        {
      unitPrice = price;
  }
        public double getUnitPrice()
  {
      return unitPrice;
  }
  
  
  // method to set Inventory value
  //public void setInventoryValue(double value)
  
  //{
  //InventoryValue = value;
  //}end method setInventoryValue
  
  //method to get InventoryValue
  //public double getInventoryValue()
  //{
  // return InventoryValue;
  //} //end method to getInventoryValue
  
  public double getInventoryValue()
  {
      return unitPrice * unitsTotal;
  }//end method to getInventoryValue
  
  //method to set TotalInventory
  //public void setTotalInventory(double value)
  
  //{
  //TotalInventory = total;
  //}end method setTotalInventory
  
  //method to get TotalInventory
  //public double getTotalInventory()
  
  //{
  //return TotalInventory;
  //}end method to getTotalInventory
  
  }//end class Camera
  </code></pre>