......简单的构造函数

来源:互联网 发布:福建师范大学网络电视 编辑:程序博客网 时间:2024/04/26 21:28
/* *用户信息 */ public class Customer{     //用户名     String username;     //登录密码     String password;     //真实姓名     String realName;     //生日     String year;     String month;     String day;     //年龄     int age;     //姓别     String gender;     //积分     int score;     //住址     String Address;     //联系方式     String phone;     //身份证号     String regNo;     //会员级别     String vip; //初始化 public Customer(){ username = "花非花雾"; password = "1019";         realName = "王芳"; year = "1993"; month = "06"; day = "12"; age = 21; gender = "男"; score = 2000; Address = "兰州市段家滩商学院"; phone = "1313113"; regNo = "620521199306121235";         vip = "6";       } public void print(){ System.out.println("");     System.out.println("\t用户信息如下"); System.out.println("用户名:" + username); System.out.println("登录密码:" + password); System.out.println("真实姓名:" + realName); System.out.println("生日:" + year + "-" + month + "-" + day ); System.out.println("年龄:" + age); System.out.println("性别:" + gender); System.out.println("积分:" + score); System.out.println("地址:" + Address); System.out.println("联系方式:" + phone); System.out.println("身份证号:" + regNo); System.out.println("会员级别:" + "VIP[" + vip + "]");  }  public static void main(String [] arges){  //创建对象  Customer yonghu = new Customer();  yonghu.print();      } }


 

0 1