[1693] in java-interest

home help back first fref pref prev next nref lref last post

Reading formatted data on keyboard

daemon@ATHENA.MIT.EDU (prepapol@lifl.fr)
Thu Sep 14 12:14:46 1995

From: prepapol@lifl.fr
Date: Thu, 14 Sep 95 15:10:32 +0200
To: java-interest@java.sun.com

Hi all,

I would like read formatted data on keyboard like strings or integer.
source in C:

int n;
char str[10];
scanf("%d", n);
scanf("%s", str);

If someone have a simple solution in Java or know if the class StreamTokenizer
is a good way to do that ?

Or must I build a new class like

class FormattedDataInputStream extend InputStream{
  String readString(){...}
  int readInt(){...}
  ...
}

Thanks

-------------------------------------------------
Bruno CUVELIER           e-mail: prepapol@lifl.fr

Universite des Sciences et Technologies de Lille
Laboratoire d'Informatique Fondemmentale de Lille
Cite Scientifique
U.F.R. d'IEEA, batiment M3
59655 Villeneuve d'Ascq CEDEX.
FRANCE
-------------------------------------------------



-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post