cannot resolve symbol

hyc_hover 2006-07-29 09:41:49
public class Garde{
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);
}
}

编译时出现2个错误:1. cannot resolve symbol
symbol:variable DialogBox
location:class Garde int testscore = DialogBox.requestInt("Please input a int number: ");
2. cannot resolve symbol
symbol:variable Transcript
location:class Garde Transcript.println("Grade = " + grade);

这2个错误是什么错误哦?为什么会产生这个错误?
是不是因为没有写 import 引入类包的原因?
...全文
179 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaotao112000 2006-07-29
  • 打赏
  • 举报
回复
1看API吧,自己定义的的类自己编程的时候会知道的
2这个问题看看书吧,我也是新手,解释不好
hyc_hover 2006-07-29
  • 打赏
  • 举报
回复
我想也应该是没有引入类包,但是这也有2个问题:
1.如何知道这个类是否是系统的类包,还是自己定义的类包?用JAVA API ?
2.为什么 在helloword中 system.out.println ,system是系统类包吧?为什么没有写import语句也能编译?
xiaotao112000 2006-07-29
  • 打赏
  • 举报
回复
应该是没有引如包吧,在这个类中没有声明DialogBox和Transcript这两个

62,615

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧