Here's is the compiler message: InventoryItemDemo.java:9: cannot find symbol
symbol : constructor InventoryItem(java.lang.String,int)
location: class InventoryItem
InventoryItem Item1 = new InventoryItem("Item 1", 41),
^
There are four more lines that say the same thing since I am trying to create 5 InventoryItems. The carrot should be under the word new.
My code is fairly simple at this point
Expand|Select|Wrap|Line Numbers
- import java.util.Scanner;
- public class InventoryItemDemo
- {
- public static void main (String[] args)
- {
- Scanner keyboard = new Scanner (System.in);
- InventoryItem Item1 = new InventoryItem("Item 1", 41),
- Item2 = new InventoryItem ("Item 2", 12),
- Item3 = new InventoryItem ("Item 3", 33),
- Item4 = new InventoryItem ("Item 4", 35),
- Item5 = new InventoryItem ("Item 5", 47);
- }
- }
Note: Recompile with -Xlint:unchecked for details." From what I understand (which is very little) the Xlint error is informational and my InventoryItem.class file is created.