Sams Teach Yourself C in 21 Days

(singke) #1

BONUS DAY 6


BONUS WEEK


More Java Techniques


Java is a full-featured and powerful language. You learned the most important
basics of Java during the previous two days. There is a lot more to learn about
Java; however, only some of the more important aspects of the language will be
covered. Today you will learn


  • How to use exceptions to deal with run-time errors

  • The basics of reading and writing files

  • How to use graphics with Java

  • How to program Java applets


Working with Java Exceptions ..........................................................................


No matter how skillful a programmer you are, you cannot guarantee that your
program will never encounter an error condition. Various circumstances out of
your control, such as user input, hardware failures, and network outages can
cause errors. A properly written program handles errors gracefully, which
means that it does not crash or cause data loss when an error occurs. Proper
error handling will also prevent an application from bringing the entire system
down when an error occurs.

41 448201x-Bonus6 8/13/02 11:23 AM Page 743

Free download pdf