public class me3fj {
String xb;
int nl;
//有参
public me3fj(String name){
this.xb="男";
this.nl=10;
}
}
public class method3 {
public static void main(String[] args) {
me3fj e3fj= new me3fj("");
System.out.println(e3fj.xb);
System.out.println(e3fj.nl);
}
}
无参的使用
public class me3fj {
String xb;
int nl;
//无参调用
public me3fj(){
this.年龄=10;
this.性别="男";
}
}
public class method3 {
public static void main(String[] args) {
//无参调用
me3fj me = new me3fj();
System.out.println(me.nl);;
System.out.println(me.xb);
}
}