为了账号安全,请及时绑定邮箱和手机立即绑定

跟着敲 为啥会报错呢

public ListTest() {

this.coursesToSelect = new ArrayList();

}

public static void main(String[] args) {

ListTest lt =new ListTest();

lt.testAdd();

}


Exception in thread "main" java.lang.Error: Unresolved compilation problems: 

Type mismatch: cannot convert from ArrayList to ListTest

The method add(Course) is undefined for the type ListTest

The method get(int) is undefined for the type ListTest


at collection.ListTest.<init>(ListTest.java:9)

at collection.ListTest.main(ListTest.java:22)


正在回答

3 回答

具体要看你写的CSS,有可能你的body上面被div覆盖了

0 回复 有任何疑惑可以回复我~

初始化方法错了。

0 回复 有任何疑惑可以回复我~
你至少把代码全部放出来把
0 回复 有任何疑惑可以回复我~
#1

Duaire 提问者

我对比了一下代码,是我一个申明自动补全给我写错了
2019-01-26 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Java入门第三季
  • 参与学习       409779    人
  • 解答问题       4339    个

Java中你必须懂得常用技能,不容错过的精彩,快来加入吧

进入课程

跟着敲 为啥会报错呢

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信