Week 3 Ex. 65 - "Illegal Start of Expression"

100 views
Skip to first unread message

gmy5011

unread,
Apr 11, 2016, 6:11:09 PM4/11/16
to mooc.fi
Hi,

I'm having problems with week 3 exercise 65.

I have no idea what this error is. I cant really find much information on the error "Illegal start of Expression"


Best regards,

gmy5011

Jarmo Isotalo

unread,
Apr 12, 2016, 5:34:57 AM4/12/16
to gmy5011, mooc.fi
You're missing a closing bracket for the for loop:    for (String word : list) {
And thus when defining the next method it fails with the Illegal start of expression, as it still is expecting the } before we can define a new method.

One way for detecting these, and seeing where the brackets are missing is to autoformat the code and then seeing in which point the indentation starts to look incorrect.

-Jarmo


--
http://mooc.fi
---
You received this message because you are subscribed to the Google Groups "mooc.fi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moocfi+un...@googlegroups.com.
To post to this group, send email to moo...@googlegroups.com.
Visit this group at https://groups.google.com/group/moocfi.
To view this discussion on the web visit https://groups.google.com/d/msgid/moocfi/e26d3ece-2133-4d65-834d-f34b1eb613c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gmy5011

unread,
Apr 12, 2016, 6:22:05 PM4/12/16
to mooc.fi, gmy...@gmail.com
Great, thank you! I must have looked over that code for an hour trying to figure out what was wrong with it... can't believe it was just a missing bracket. I think I got hung up, because the error was showing for the next statement, but based on the problem it makes sense now. I will definitely focus on using auto format for my future exercises.
Reply all
Reply to author
Forward
0 new messages