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