package cn.cph.homework;
public class User {
//用户名
String id;
//密码
int pwd;
//电子邮件
String email;
public User() {
}
//全参构造
public User(String id,int pwd,String emsil) {
this.id = id;
this.pwd = pwd;
this.email = emsil;
}
public User(String id,int pwd) {
this.id = id;
this.pwd = pwd;
this.email = id+"@gameschool.com";
}
public void show() {
System.out.println("id:"+id);
System.out.println("pwd:"+pwd);
System.out.println("email:"+email);
}
public static void main(String[] args) {
User user = new User("张三",234);
User user2 = new User("张三",234,"3242545");
user.show();
System.out.println("------------------------------");
user2.show();
}
}
}