/* Clase : LecturaCaracter.java
 * Programa para leer caracteres desde el teclado
 */
 import java.io.*;
 public class LecturaCaracter{
     public static void main(String[] args)throws IOException
     {
        InputStream  fis= System.in;//abrir canal del teclado
	lecturaCaracter(fis);
	lecturaCaracteres(fis);

     }
     public static void lecturaCaracter(InputStream lect)throws IOException
     {
	 int c;
	 System.out.println("Escribir un caracter\n ");
	 c=lect.read();
	 System.out.println((char)c);
     }
     
     public static void lecturaCaracteres(InputStream lect)throws IOException
     {
	int c;
	String texto ="";
	System.out.println("Escribir el texto\n ");
	while((c=lect.read())!=-1)
		texto = texto + (char)c;
        System.out.println("\n"+texto);
     }
 }
