class Account{
private String acc;
private int money;
public Account(){
}
public Account(String acc){
this.acc = acc;
}
public Account(String acc,int money){
this.acc = acc;
this.money = money;
}
public String getAcc(){
return this.acc;
}
public int getMoney(){
return this.money;
}
public void print(){
System.out.println("账户:"+this.acc+"\t"+"余额:"+this.money);
}
}
public class Demo02{
public static void main(String args[]){
Account acc[] = new Account[4];
acc[0]= new Account("张三",200);
acc[1]= new Account("李四",400);
acc[2]= new Account("王五",800);
acc[3]= new Account("赵二");
for(int i = 0;i <= 3;i++){
acc[i].print();
}
}
private String acc;
private int money;
public Account(){
}
public Account(String acc){
this.acc = acc;
}
public Account(String acc,int money){
this.acc = acc;
this.money = money;
}
public String getAcc(){
return this.acc;
}
public int getMoney(){
return this.money;
}
public void print(){
System.out.println("账户:"+this.acc+"\t"+"余额:"+this.money);
}
}
public class Demo02{
public static void main(String args[]){
Account acc[] = new Account[4];
acc[0]= new Account("张三",200);
acc[1]= new Account("李四",400);
acc[2]= new Account("王五",800);
acc[3]= new Account("赵二");
for(int i = 0;i <= 3;i++){
acc[i].print();
}
}
}
功能:开户和查询