[Bluej-discuss] Ex 4.51
John Simonds
simonj2 at sage.edu
Wed Oct 4 18:51:09 BST 2006
But this exercise called for a for each loop (enhanced for loop) - which the book shows as :
for ( Type Identifier : Expression )
Statement
and does not show semi -colon
John Simonds
Systems Technologist
simonj2 at sage.edu
(518)244-3111
(518)292-1734
---------------------------------------
Original E-mail
From: Brian Brookwell
Sent: 10/04/2006 01:41 PM
To: John Simonds , General discussion for users of BlueJ
Subject: Re: [Bluej-discuss] Ex 4.51
On 4-Oct-06, at 11:38 AM, John Simonds wrote:
>
> I have the following code for the for each in exercise 4.51:
>
> public void listNotes( )
>
> {
>
> index = 0;
>
> for(int index : index ++) {
> ^ should be a semi-colon and for loop
> has three components eparated by ; not two
>
> System.out.println(notes.get(index));
>
> }
> }
>
> This results in an error. I am not understanding why it doesn't
> see index as a variable.
> John Simonds
> Systems Technologist
> simonj2 at sage.edu
> (518)244-3111
> (518)292-1734
>
>
> _______________________________________________
> mailing list bluej-discuss at bluej.org
> To unsubscribe or change your preferences, go to
> http://lists.bluej.org/mailman/listinfo/bluej-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bluej.org/pipermail/bluej-discuss/attachments/20061004/f1008e98/attachment.html
More information about the bluej-discuss
mailing list