I need to create an object (a bank) which has an array of clients and bankID. My problem is that I don't know how to create a bank in main function.
Bank class:
public class Bank {
Client[] client=new Client[20];
String idBank;
public Bank(Client[] client,String idBank) {
this.client=client;
this.idBank=idBank;
}
public Bank(Bank b) {
b.client=client;
b.idBank=idBank;
}
Client class:
public class Client {
String name;
String address;
BancAccount[] banc=new BancAccount[50];
public Client(String name,String address,BancAccount[] banc) {
this.name=name;
this.address=address;
this.banc=banc;
}
public Client(Client c) {
c.address=address;
c.name=name;
c.banc=banc;
}
}
Main class:
public class Lab5 {
public static void main(String[] args) {
Bank[] b1=new Bank(client[3],"14332");
}
}
These is the problem :
You have to create a program to simulate a bank activity. The system includes the following modules: Bank — clients (array of Client) — idBank (String) 5 BancAccount — accountNumber (String) — amount (float) Client — name (String) — address (String) — accounts (array of BankAccount; a client can have at least an account, but not more than five accounts)