Exemple d’utilisation de la classe ‘StreamTokenizer’ pour lire le clavier

Author:


{filelink=12340}

import java.io.*;
public class LecturClavier {
   public static void main (String args[]) {
      StreamTokenizer entree=new StreamTokenizer(System.in);
       try {
         System.out.print("Tapez votre nom: ");
         entree.nextToken();
         System.out.println("Bienvenu:  " + entree.sval + "!");
      }
      catch (Exception err) {
         err.printStackTrace();
      }
   }
}

Leave a Reply

Your email address will not be published. Required fields are marked *