Hello everyone, i have a homework that i've been trying to do for like 2 weeks, it's a program to simulate a client with several bank accounts, each account has an account number and his balance...I've done everything else and the last thing i need to do is create a static array that holds the accounts in it.
I already have a class "Compte" which is a class for one account, and the objective is to create another class "Client" which holds several accounts so i guess i should create objects from the "Compte" class and then store the created objects in the array, i created the array using :
Compte comptes[] = new Compte[10];
and then made the first object using:
Compte compte = new Compte(1);
and now the problem is storing "compte" object in the array, i try:
comptes[0] = compte;
and it gives me:
cannot find symbol
symbol: class comptes
location: class client
']' expected
<identifier> expected
I'm using NetBeans IDE.
I asked the teacher several times why is it happening and everytime he says i should figure it out on my own and all he said to me is put the code in the constructor..(All the code above is in the Client class)
Question: why can't i store the object "compte" created earlier in the array, should i put the code elsewhere ?