wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes illegal start of expression?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "illegal start of expression??" Watch "illegal start of expression??" New topic
Author

illegal start of expression??

Fazz
Greenhorn

Joined: Mar 16, 2006
Posts: 9
When attempting to compile the following code, i recieved the message, 'illegal start of expression', with the line in bold, highlighted. Any ideas what that would mean???


private void go() {
String test = "Mary had a little lamb";
for(StringTokenizer token = new StringTokeizer(test); token.hasMoreTokens() {
String word = token.nextToken();
System.out.println("Word = " + word);
}
}
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Hi,

Welcome to JavaRanch!

It generally means that there's a real error on a line before this. The most likely problem is a missing close-brace, so that this method declaration seems to appear inside the preceding method.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: illegal start of expression??
 
Similar Threads
may you guess where error I get: script: stop/start animation image
java problems
HELP?! set up an iterator & put entries Collection into display List
method inside main method
Simple problem