File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

illegal start of expression??

 
Fazz
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic