Well to be honest its part of a project. I have a linked list (bunch of objects, one set as the start with each one pointing to the next one).
The code for the linked list as well as the objects is already done and probably shouldn't be changed.
The objects in this are the OBjectStoreTwo in that they contain another object from a different class. Im trying to store the PaintCan inside the objects and use a different class (Shelf) to add/remove and look on the shelf.
In the shelf class i have a method:
public void AddPaintCan(String brand, String color, int size)
{ paintCan = new PaintCan(brand, color, size); }
The linked list is declared as LL
With another method which uses this method:
[input for brand, color and size. All working and tested as well as the AddToLinkedList method]
LL.AddToLinkedList(Beginning, paintCan);
I can then use a System.out.print(LL.Look(1)); to show the pointer to the paintcan or:
System.out.print(paintCan.brand); to show the brand from the last entered paintcan.
The problem is when i try to use something like:
Object thisPaintcan = LL.Look(1);
System.out.print(thisPaintcan.brand);
I am sorry if this is confusing (its confusing for me as well
).