[1677] in java-interest
switch
daemon@ATHENA.MIT.EDU (prepapol@lifl.fr)
Wed Sep 13 20:04:51 1995
From: prepapol@lifl.fr
Date: Wed, 13 Sep 95 22:33:28 +0200
To: java-interest@java.sun.com
Hello,
I've compiled this :
class Switch{
public static void main(String args[]){
do{
switch((int)System.in.read()){
case 0: System.out.println("cas"+0);break;
case 1: System.out.println("cas"+1);break;
case 2: System.out.println("cas"+2);break;
case 3: System.out.println("cas"+3);break;
default: System.out.println("Terminated");break;
}
}while(true);
}
}
and I've this execution
%java Switch
0
Terminated
Terminated
1
Terminated
Terminated
3
Terminated
Terminated
4
Terminated
Terminated
...
Is anybody have an idea ? I haven't found a light solution about the syntax
of switch in the doc...
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