Boa noite pessoal! Sou novo em Java e estou criando o bloco abaixo, o objetivo é receber textos ate receber EXIT, só que o compilador me dá UNREACHABLE CODE na linha do sc.nextLine(). Alguem sabe me dizer o pq? Desde já agradeço!
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (1 != 2)
System.out.println("Digite Aqui:");
String texto = sc.nextLine();
if (texto.equals("exit")){
System.exit(0);
}
System.out.println(texto + " Foi digitado!");
}
Abraços!
