"这不是一个类就可以实现的,简单的类设计思路如下:
一、定义三个类分别为:
1、User(账号用户,比如张大爷,张大妈等);
2、Account(账户信息);
3、AccountRecord(账户消费记录);
二、类大概实现:
publicclassUser{
privateintid;
//关联用户
privateUseruser;
//关联用户类型
privateStringuserType;
//用户姓名
privateStringuserName;
//账户
privateAccounntaccount;
publicintgetId(){
returnid;
}
publicvoidsetId(intid){
this.id=id;
}
publicStringgetUserName(){
returnuserName;
}
publicvoidsetUserName(StringuserName){
this.userName=userName;
}
publicAccounntgetAccount(){
returnaccount;
}
publicvoidsetAccount(Accounntaccount){
this.account=account;
}
publicStringgetUserType(){
returnuserType;
}
publicvoidsetUserType(StringuserType){
this.userType=userType;
}
publicvoidsetUser(Useruser){
}
}
"