问答详情
源自:4-4 学生选课---添加课程 Ⅰ

跟着敲 为啥会报错呢

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)


提问者:Duaire 2019-01-26 13:40

个回答

  • 慕移动9181930
    2022-03-25 13:36:57

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

  • 创客2018
    2019-01-26 16:04:52

    初始化方法错了。

  • 慕少3069153
    2019-01-26 15:49:41

    你至少把代码全部放出来把