public class bankAccount
{
String name;
double money;
public bankAccount(String name , double money)
{
this.name = name ;
this.money = money ;
}
public bankAccount(String name)
{
this.name = name ;
this.money = 0 ;
}
public double amountOfMoney(double money)
{
return this.money ;
}
public void deposit(double money)
{
this.money += money;
}
public void withdrawal(double money)
{
this.money -= money;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public double getMoney()
{
return money;
}
public void setMoney(double money)
{
this.money = money;
}
public String toString()
{
return "bankAccount [name=" + name + ", money=" + money + "]";
}
public void unionAccount(bankAccount difAccount)
{
this.money += difAccount.getMoney();
}
public void Accounts(bankAccount[] bankArr)
{
for(int i = 0 ; i < bankArr.length ; i ++)
System.out.print("[" + bankArr[i].toString());
System.out.print("]");
System.out.println();
}
}
Comments