Lesson8.Exceptions and Logging


Lesson 8. Exceptions and Logging

In this lesson you will learn about exceptions and logging. Exceptions in Java are a transfer control mechanism. You generate exceptions to signal problematic conditions in your code. You write code to either acknowledge or handle exceptions that are generated.

Java provides a flexible logging facility that allows you to record information as your application executes. You might choose to log exceptions, interesting occurrences, or events that you want to track.

Things you will learn include:

  • the try-catch block

  • checked vs. unchecked (runtime) exceptions

  • errors vs. exceptions

  • the tHRows clause

  • the exception hierarchy

  • creating your own exception type

  • exception messages

  • working with multiple exceptions

  • rethrowing exceptions

  • working with the stack trace

  • the finally block

  • the Formatter classes

  • the Java logging API

  • logging to files

  • logging handlers

  • logging properties

  • logging hierarchies



Agile Java. Crafting Code with Test-Driven Development
Agile Javaв„ў: Crafting Code with Test-Driven Development
ISBN: 0131482394
EAN: 2147483647
Year: 2003
Pages: 391
Authors: Jeff Langr

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net