- Syntax error on token ",",< expected - This method has a constructor namepublic void StuXinXi1(String_id ,String_name,String_changHao,String_duanHao){ this.id = _id; this.name = _mame; this.sex = _sex; }这段为什么会出现- Syntax error on tok
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 01:26:48
- Syntax error on token ",",< expected - This method has a constructor namepublic void StuXinXi1(String_id ,String_name,String_changHao,String_duanHao){ this.id = _id; this.name = _mame; this.sex = _sex; }这段为什么会出现- Syntax error on tok
- Syntax error on token ",",< expected - This method has a constructor name
public void StuXinXi1(String_id ,String_name,String_changHao,String_duanHao){ this.id = _id; this.name = _mame; this.sex = _sex; }这段为什么会出现- Syntax error on token ",",< expected
\x05- This method has a constructor name
\x05- Syntax error on token ",",TypeArgument1 expected after this
\x05 token这些问题
- Syntax error on token ",",< expected - This method has a constructor namepublic void StuXinXi1(String_id ,String_name,String_changHao,String_duanHao){ this.id = _id; this.name = _mame; this.sex = _sex; }这段为什么会出现- Syntax error on tok
1.参数列表需要有参数类型和参数名字,他们中间要用空格分开,你现在写的都是String_name 这样子,其中String是类型,name是参数名字,当中的下划线是多余的
2.你没有贴完整的代码,但是从报的错误来看,StuXinXi1 这个方法和该方法所在的类同名,同名的方法会被认为是构造函数,但是构造函数不能有返回类型.所以,你有两个选择,如果你想写构造函数,那么把返回类型void去掉; 反之则把这个方法的名字改成别的