Hi
I am try a program in java where I need to user the scanner class. The problem is that I can't manage my scanner to read an int. I am posting my code below. Can you please help me to solve this.
Code:System.out.println("Maak een selectie uit de volgende opties..." + "\n" + "1" + ". Nieuwe tafel openen." + "\n" + "2" + ". Toon open tafels." + "\n" + "3" + ". Gebruiker opties"); String a = sc.next(); if(a.equals("1")){ System.out.println("some text here"); int p = sc.nextInt(); Here is the problem if(p.equals(waiterz.getPin())){ System.out.println("soem more text here"); System.out.println("example"); System.out.println("1" + ". Drank Toevoegen" + "\n" + "2" + ". Eten Toevoegen" + "\n" + "3" + ". Afrekenen" + "\n" + "4" + ". Bestelling corrigeren" + "\n" + "5" + ". Choose your weapon!");
Bookmarks