import java.lang.System;
import java.applet.Applet;
import java.awt.*;
import
public class IfTestClass extends Applet{
public static void main(String args[]){
int character;
try{
System.out.println("Please Enter a number 1 to 7:");
character=(int)System.in.read();
//(char)(System.in.read());
if(character==-1)
System.out.println("\n No character entered!");
else if(character==1)
System.out.println("\n Today is Monday!");
else if(character==2)
System.out.println("\n Today is 2!");
else if(character==3)
System.out.println("\n Today is 3!");
else if(character==4)
System.out.println("\n Today is 4!");
else if(character==5)
System.out.println("\n Today is 5!");
else if(character==6)
System.out.println("\n Today is 6!");
else if(character==7)
System.out.println("\n Today is Sunday!");
else
System.out.println("\n You have entered a wrong number!");
//System.out.println("\n "+character);
//System.out.println("***in TRY***");
}catch(IOException e){
System.err.println("Catch IOException:"+e.toString());
}
}
}
就是这个啊!