fork download
  1. import java.util.Scanner;
  2.  
  3. class Main {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6. while (true) {
  7. System.out.println("Confirma?");
  8. if (sc.nextLine().equals("s")) break;
  9. }
  10. System.out.println("confirmado");
  11. sc.close();
  12. }
  13. }
  14.  
  15. //https://pt.stackoverflow.com/q/431680/101
Success #stdin #stdout 0.11s 35388KB
stdin
n
s
stdout
Confirma?
Confirma?
confirmado