My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.lineadecodigo.java.util;

/**
* @file LecturaConsolaScanner.java
* @version 1.0
* @author Linea de Codigo (http://lineadecodigo.com)
* @date 31-diciembre-2008
* @url http://lineadecodigo.com/2008/01/01/lectura-de-datos-en-java-con-scanner/
* @description Ejemplo de lectura de datos por consola mediante la clase Scanner.
*/

import java.util.Scanner;

public class LecturaConsolaScanner {

public static void main(String[] args) {

Scanner reader = new Scanner(System.in);
String sTexto = "";

System.out.println("Escribe palabras hasta que te canses. Entonces escribe FIN");

do {
sTexto = reader.next();
System.out.println(sTexto);
} while(!sTexto.equals("FIN"));
}

}

Change log

r60 by vcuervo on Jan 1, 2009   Diff
Lectura de datos por consola
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 748 bytes, 29 lines
Powered by Google Project Hosting