Java 对象创建错误
package Sartre.Connect4;
import javax.swing.*;
public class ChatGUI extends JDialog {
public ChatGUI(){
setTitle("Chat");
}
当
我在同一个包中的另一个类中执行此操作时:
ChatGUI chatGUI = new ChatGUI();
我最终遇到一种情况:找不到符号
请帮忙?
package Sartre.Connect4;
import javax.swing.*;
public class ChatGUI extends JDialog {
public ChatGUI(){
setTitle("Chat");
}
}
when i do this in another class in the same package:
ChatGUI chatGUI = new ChatGUI();
i end up with a situation: Cannot Find Symbol
please help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“找不到符号”意味着编译器找不到代码中正在使用的类、方法或字段(它还会准确地告诉您是哪一个)。这意味着以下两件事之一:
"Cannot Find Symbol" means that the compiler cannot find a class, method or field that's being used in your code (it wil also tell you exactly which one). This means one of two things:
两个文件都在目录中吗
如果结构是,可能会弄乱
Are both files in the directory
It might mess things up if the structure is