Skip to main content

Exception Handling

  • Chapter
  • First Online:
Java Quick Syntax Reference
  • 1881 Accesses

Abstract

Exception handling allows programmers to deal with unexpected situations that may occur in their programs. As an example, the FileReader class in the java.io package is used to open a file. Creating an instance of this class will cause Netbeans to give a reminder that the class's constructor may throw a FileNotFoundException. Attempting to run the program will also cause the compiler to point this out.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 19.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Mikael Olsson

About this chapter

Cite this chapter

Olsson, M. (2013). Exception Handling. In: Java Quick Syntax Reference. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-6287-9_20

Download citation

Publish with us

Policies and ethics