aspose file tools
The moose likes Beginning Java and the fly likes illegal start of expression?? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 24054
    
  13

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
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
Simple problem
method inside main method