java 问题
class Student{
String school;
Student(String name,String school){
this(String name,String school,"beijing");
}
}
编译器总是提示有错误,可是我很难找到,请各位帮帮我。
需要')'
this(String name,String school,"beijing");
^
------解决方案--------------------this(String name,String school,"beijing");
这里是方法调用不是方法定义,
应该是this(name,school,"beijing");
不过没看到你定义构造方法
Student(String name,String school,String position){
...
}
这样即使this调用构造方法写的正确了也找不到相应的构造方法