/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ejercicios; import java.util.Scanner; /** * * @author roshka */ public class Ejercicio09 { public static void main(String[] args){ String pass = "holaxd"; String pass2; Scanner scr = new Scanner(System.in); for (int i = 1; i < 4; i++){ System.out.println("Ingrese contrasena: "); pass2 = scr.nextLine(); if (pass.equals(pass2)) { System.out.println("Correcto"); return; }else{ System.out.println("Fallaste jaja xd"); } } System.out.println("Hule amigo"); } }