List vs ArrayList

后端 未结 6 568
春和景丽
春和景丽 2021-01-23 20:31
List> listeners = new List>();

Why the line above fails with:

Cannot in

6条回答
  •  旧巷少年郎
    2021-01-23 20:59

    List is only an Interface which is implemented by ArrayList

    see: http://download.oracle.com/javase/6/docs/api/java/util/List.html

提交回复
热议问题