validación
Publicado por Luis (2 intervenciones) el 03/03/2014 14:47:33
Agradeceré mucho su ayuda en el siguiente post
Porque en el siguiente código cuando escribo "fin" no termina el programa???
Porque en el siguiente código cuando escribo "fin" no termina el programa???
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class nombres2 {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
ArrayList<String> vnombres = new ArrayList<>();
InputStreamReader leenombres = new InputStreamReader(System.in);
BufferedReader buffnombre = new BufferedReader(new InputStreamReader(System.in));
String nombre = "";
while (nombre != "fin") {
nombre = buffnombre.readLine();
vnombres.add(nombre);
System.out.println(nombre);
System.out.println(vnombres);
}
}
}
Valora esta pregunta


0