I'm trying to open a text file for input using the Eclipse IDE and I'm receiving error messages I can't resolve. Here's my code:
Eclipse flags the "String file" line as an error with the following message:
Syntax error on token ";", { expected after this token
It also flags the final } with this message:
Syntax error, insert "}" to complete ClassBody
What am I doing wrong here?
TIA!
~~Tom
Tom Reilly
Rancher
Joined: Jun 01, 2010
Posts: 618
posted
0
You cannot just add code to a class. You have to put the code in a method. Also, Stdout is not Java. See below.
Tom Brodhead
Greenhorn
Joined: Jan 02, 2011
Posts: 25
posted
0
Thanks--this was an embarrassing brain fart--forgot to put it into a method. I'm actually planning on calling the resulting method from a class with a main() method elsewhere; the Stdout routine is part of the larger package this belongs to.
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.