package practice;
class LinkedList
{
Node head; // head of list
/* Node Class */
class Node
{
int data;
Node next;
// Constructor to create a new node
Node(int d) {data = d; next = null; }
}
public static void main(String args[]){
LinkedList lkd=new LinkedList().new Node();
}
}
答案 0 :(得分:0)
您的构造函数似乎只接受一个参数。除非使用不带参数的构造函数覆盖,否则请尝试:
LinkedList.Node lkd = new LinkedList().new Node(**int d here**);