更新时间:2022-06-08 21:27:20
这:
public void Node(String x) {
data = x;
next = null;
}
应为:
public Node(String x) {
data = x;
next = null;
}
目前你有一个默认构造函数(没有arguments),在没有任何显式构造函数的情况下隐式定义。
Currently you have a default constructor (taking no arguments), which is implicitly defined in the absence of any explicit constructors.