且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

类中的Java'构造函数不能应用于给定类型''required:找不到任何参数:String'

更新时间: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.