求各位大侠解释这个程序的意思 要细解 从protected开始
import java.io.BufferedReader;import java.io.IOException;
import java.io.InputStreamReader;
public class CompareScore{
/**
*@param args
*/
public static void main(String args[]){
//TO Auto-generated method stub
CompareScore cs=new CompareScore();
try{
String gradetmp=cs.getInput("请输入你的考试成绩");
int grade=Integer.parseInt(gradetmp);
if (grade>=95)
{
System.out.println("your achivement is excellent");
}
else if (grade>=85)
System.out.println("your achivement is good");
else if(grade>=75)
System.out.println("your achivement is middling");
else if(grade>=60)
System.out.println("your achivement is passed");
else
System.out.println("your achivement is bad");
}
catch(Exception e)
{
e.printStackTrace();
}
}
protected String getInput(String question)throws IOException{
BufferedReader StdIn=new BufferedReader(new InputStreamReader(System.in));
System.out.println(question);
return StdIn.readLine();
}
}
--------------------编程问答-------------------- 这个……
补充:Java , Java相关