System.out.println("Все верно?(y/n)");
Scanner answ = new Scanner(System.in);
if (answ.nextLine() == "y")
System.out.println("Ok");
if (answ.nextLine() == "n")
System.out.println("Try again");
else
System.out.println("Неверный ввод(y/n)");