This site requires JavaScript, please enable it in your browser!
Greenfoot back
divinity
divinity wrote ...

2016/11/29

cannot find symbol, help

1
2
divinity divinity

2016/11/30

#
when i took the screenshot, it wasnt there but it say cannot find symbol am sure you are seeing the red line by client
danpost danpost

2016/11/30

#
You could have told us that 'client' on lines 45, 49 and 54 (in your ATM class code post above) was underlined in red. That is what the compiler cannot find. There is a 'client' variable that is declared and assigned a Client object at the end of the 'for' loop (lines 16 to 30); but each one created is immediately lost when the loop attempts to iterate. You are creating 10 Client object and absolutely nothing is being done with them. You can assign them to the Person array by using:
1
p[i] = new Client(n, a, c, cn);
However, it is unclear as to whether all clients are to have all three types of accounts or not; so, how to use the clients in the following codes is unknown. At any rate, all the codes from line 31 to line 55 will execute just once because it is outside the scope of the 'for' loop.
divinity divinity

2016/11/30

#
divinity divinity

2016/11/30

#
hi danpost and super_hippo I got it fixed. thanks you a lots danpost and super_hippo. much appreciate all the help. System.out.println(" BIG HUGS TO YOU BOTH");
You need to login to post a reply.
1
2