Ejemplo sencillo del uso de la clase BufferedReader y del Input Stream Reader, como podemos apreciar nos guarda lo que typeamos con el teclado y lo utiliza a modo que nos regresa la información.
package teststream;
import java.io.*;
/**
*
* @author
____ _ _ _ _ _____
/ __ \ | | | | | | | |/ ____|
| | | |_ __| | __ _ _ __ __| | ___ | |__| | |
| | | | '__| |/ _` | '_ \ / _` |/ _ \| __ | |
| |__| | | | | (_| | | | | (_| | (_) | | | | |____
\____/|_| |_|\__,_|_| |_|\__,_|\___/|_| |_|\_____|
*/
public class KeyboardInput {
public static void main(String[] args) {
String s;
System.out.print ("Digita tu nombre: ");
InputStreamReader ir = new InputStreamReader(System.in);
BufferedReader in=new BufferedReader(ir);
try{
s = in.readLine();
while (s!=null){
System.out.println("Tu Nombre es: " + s + " ñ___ñ" );
System.out.println("Creado por @OrlandoHC Visita http://www.orlandohc.org");
s = in.readLine();
}
}catch (Exception ex){}
}
private static void showInputDialog(String string) {
}
}
Espero les sea de ayuda.Hack a day...
Bytes!





1 comentarios:
si pero diga tu nombre no dañe el idioma gracias
Publicar un comentario