I am just doing some practice, creating a small vending machine program. I have a linked list of "Items" each with a number of variables for name, price etc. I am trying to print out the contents of my linked list whilst i am testing the operations i have created in a separate file named "VendOperations"
toString method i want to print out
An example of how i have added an item to the linked list and then the toString method being used.Code:
public String toString()
return getClass().getName() + " " + Name + " " + ItemID + " " + Quantity + " " + Price + " " + Keypad;
The output i get is thisCode:
Not sure why it isn't printing out correctly.Code: