toString only works every second iteration of the loop.
Josh Brand wrote:This is also after having added scan.nextLine(); after the num=scan.nextInt(); on line 13 as correctly highlighted by Carey Brown.
Carey Brown wrote:You have "setName()", it should be called "getName()".
You currently have no need for setters.
Liutauras Vilda wrote:You could try maybe to follow similar template for a start.