帮我看看为什么会报错呢

a384311712 2013-09-01 08:17:41
package org.lxh.info.vo;

import java.util.Date;

public class Peron {
private int pid;
private String name;
private int age;
private Date birthday;
private String address;

public Peron(){
super();
}

public Person(int pid,String name,int age,Date birthday,String address){
this.pid = pid;
this.name = name;
this.age = age;
this.birthday = birthday;
this.address = address;
}

public int getPid() {
return pid;
}

public void setPid(int pid) {
this.pid = pid;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public int getAge() {
return age;
}

public void setAge(int age) {
this.age = age;
}

public Date getBirthday() {
return birthday;
}

public void setBirthday(Date birthday) {
this.birthday = birthday;
}

public String getAddress() {
return address;
}

public void setAddress(String address) {
this.address = address;
}

}
红线部分报错,原因是Return type for the method is missing 怎么解决啊 我想写向构造方法内传入参数
...全文
318 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
每天三道题 2013-10-16
  • 打赏
  • 举报
回复
类名和构造方法名不一致
valenon 2013-09-03
  • 打赏
  • 举报
回复
撸主贱笑了。。。
nemorick 2013-09-03
  • 打赏
  • 举报
回复
又见记事本高手出现。。。。
柔龙笑 2013-09-03
  • 打赏
  • 举报
回复
wufei151 2013-09-02
  • 打赏
  • 举报
回复
单词写错了,类名是Peron,构造方法名是Person
AndroidDev2022 2013-09-01
  • 打赏
  • 举报
回复
拼写错误,这个用专业的工具就会避免了。
地下室森林 2013-09-01
  • 打赏
  • 举报
回复
class 类名和构造方法的方法名不一样 话说这样eclipse不报错吗
  • 打赏
  • 举报
回复
记事本敲的吧,eclipse中就不会出现这种错误的哦
pander520 2013-09-01
  • 打赏
  • 举报
回复
………………看看你的class名称和构造函数名称!!! 写错啦!!!
xiaozhou10 2013-09-01
  • 打赏
  • 举报
回复
搞笑了吧。类是:Peron 方法你写:Person了自己看

62,615

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧