Change it to a constructor argument at the same time, and make the caller have a member variable for that same dependency.
同时给构造函数加上相应的参数,给构造函数的调用者加上一个成员变量来体现依赖关系。
Be sure to change the package, class, and constructor names in the Java code to match the project name.
确认代码中的包名、类名以及类构造函数名都已改为与项目名一致。
Then you change the constructor to take the name of the table, as well as the names of the fields in the table.
然后,把构造函数修改成接受表的名称和表中字段的名称。
应用推荐