PDA

View Full Version : [SOLVED] Java Tutorial Compiling Error



Knax0815
May 4th, 2014, 11:36 AM
Hi guys,

so I started reading a online book about programming and was starting to do some coding but I bounced into a for me unsolveable error.

The Book, http://www.javacoffeebreak.com/books/extracts/javanotesv3/index.html

TextIO.class http://www.javacoffeebreak.com/books/extracts/javanotesv3/source/TextIO.java

My Problem, when I am compiling the TextIO.java



javac TestIO.java

I get this error msg.



TextIO.java:536: error: unreachable statement
throw new RuntimeException("End-of-file on standard input.");;
^
1 error



So I am quiet puzzled, is there some bug in the sourcecode ? Which I can hardly imagine.
I think my problem lies how i copy the text from the webseite into my .java file ? Or any other suggestions how I could fix this problem or where I am doing something wrong.

Here is how I created the file.


touch TextIO.java

After that I opend the file with the standard texteditior of ubuntu and pasted the code.

Thanks for all help, I hope I explained myself good enough...

dwhitney67
May 4th, 2014, 11:55 AM
Remove the extra semi-colon at the end of the statement. Only one semi-colon is needed to terminate a statement.

Knax0815
May 4th, 2014, 12:08 PM
Hm, okay that solves it.

Thanks :D