package week5; import java.util.Scanner; public class ex2 { public static void main(String[] args) { Scanner myInput = new Scanner(System.in); System.out.println("Please enter your ID no."); int id = myInput.nextInt(); while (id != 5) { System.out.println("Wrong id entered"); id = myInput.nextInt(); // Add this line to allow re-entering the ID } } }