我正在創建一個類,雙向鏈表和ListNode作爲內部類。我不能在我的代碼中實例化類Integer的對象(Java)
public class DoublyLinkedList<Integer> {
/** Return a representation of this list: its values, with adjacent
* ones separated by ", ", "[" at the beginning, and "]" at the end. <br>
*
* E.g. for the list containing 6 3 8 in that order, return "[6, 3, 8]". */
public String toString() {
String s;
ListNode i = new ListNode(null, null, *new Integer(0)*);
爲什麼我得到錯誤,無法實例化類型Integer
?
向我們展示'ListNode'類的定義。 –