I am new to Programming, Java is my first language that I would like to learn. Currently I am trying to learn Java with the help of Head First Java, I got some problems with the Extra - Strength Methods chapter.. I am confused on how to separate all my classes and let them interact in my main(), so I come up with exercises and one of the ideas that I am currently working on is the Vending Machine Program, currently I have 3 classes, first is
and the second one is,
and to test my methods I come up with the TestDrive Class(but i guess this should be a real class, I am really confuse with this one).
Now the problem is I want to know what of these codes is unnecessary and the problem with the setOrder() method if I input a greater number than 3 it will go to the next method that will ask for the quantity my desired output should be if the user inputted a number that is greater than 3 it will just print "Invalid Selection" on the screen. I hope someone could be of help. thanks