阿里 未来屏:一个简单的java程序问题

来源:百度文库 编辑:高校问答 时间:2024/05/06 19:52:37
请问下面这个程序有错吗?我运行时总说找不到符号
public class MyClass1{
public static void main(String[] args){
int testscore = DialogBox.requestInt("Please input a int number:");
char grade;
if (testscore >= 90){
grade = 'A';
}else if (testscore >= 80){
grade = 'B';
}else if (testscore >= 70){
grade = 'C';
}else if (testscore >= 60){
grade = 'D';
}else{
grade = 'F';
}
Transcript.println("Grade = "+grade);
}
}
请说一下具体怎么申明,谢谢!

DialogBox,Transcript都没有声明。

DialogBox,Transcript你用import引入了吗?
他们所在的包要声明一下

在代码最前面用import导入那两个类的所在的位置