Java Reference
In-Depth Information
Make it stop!
Make it stop!
...
Make it stop!
Exception in thread "main" java.lang.StackOverflowError
at sun.nio.cs.SingleByteEncoder.encodeArrayLoop(Unknown Source)
at sun.nio.cs.SingleByteEncoder.encodeLoop(Unknown Source)
at java.nio.charset.CharsetEncoder.encode(Unknown Source)
at sun.nio.cs.StreamEncoder$CharsetSE.implWrite(Unknown Source)
at sun.nio.cs.StreamEncoder.write(Unknown Source)
at java.io.OutputStreamWriter.write(Unknown Source)
at java.io.BufferedWriter.flushBuffer(Unknown Source)
at java.io.PrintStream.newLine(Unknown Source)
at java.io.PrintStream.println(Unknown Source)
at Infinite.oops(Infinite.java:7)
at Infinite.oops(Infinite.java:8)
at Infinite.oops(Infinite.java:8)
at Infinite.oops(Infinite.java:8)
at ...
Runtime errors are, unfortunately, something you'll have to live with as you learn to
program. You will have to carefully ensure that your programs not only compile suc-
cessfully, but do not contain any bugs that will cause a runtime error. The most com-
mon way to catch and fix runtime errors is to run the program several times to test its
behavior.
1.5 Case Study: DrawFigures
Earlier in the chapter, you saw a program called DrawFigures1 that produced the
following output:
/\
/ \
/ \
\ /
\ /
\/
\ /
\ /
\/
/\
/ \
/ \
 
 
Search WWH ::




Custom Search