无法解析为空气曲棍球小程序类型
嘿,我是一个完全的 Java 菜鸟,我一直在遵循一个在线教程,教我创建 Java 应用程序,我已经使用了他们为我设计的空气曲棍球小程序的模板,但我得到了“无法解析为类型”错误冰球和每支球队。一段似乎是错误根源的代码如下:
private Puck puck;
private Team humanTeam;
private Team compTeam;
你们有没有给我任何解决方案/提示,或者我只是把这个完全搞砸了?我之前已经用谷歌搜索过,但找不到任何相关内容。
Hey I am a complete Java noob and I have been following an online tutorial teaching me to create Java apps I have used the template they game me for an air hockey applet exactly but I get "can not be resolved to a type" error for my puck and each team. A piece of the code that appears to be the root source of the errors is as follows:
private Puck puck;
private Team humanTeam;
private Team compTeam;
Do you guys have any solutions / tips for me or have I just messed this one up completely? I have googled it before hand and can't find anything about it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(1) 确保您已声明类,例如
(2) 如果声明了类,则它们在您创建引用的位置可见,例如,
如果 Team 位于一个名为
airhockey
的包,如上所述。(1) Make sure you have declared the classes, e.g.
(2) and if you have, that they are visible where you are creating a reference, e.g
if Team is in a package called
airhockey
, as above.