package com.bjsxt.test2;
public class User {
int id;
String name;
String pwd;
public User(int id,String name){
this.id = id;
this.name = name;
}
public User(int id,String name,String pwd){
this(id,name);
this.pwd = pwd;
}
public void login(){
System.out.println("登陆了:"+this.name);
}
public static void main(String[] args) {
User u1 =new User(100,"gao");
u1.login();
}
}
04-27
1646
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-16
3441
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)