OCP EXAM OBJECTIVES COVERED IN THIS CHAPTER:
- Exception Handling and Assertions
- Use the try‐with‐resources construct
- Create and use custom exception classes
- Test invariants by using assertions
- Use the Locale class
- Use resource bundles
- Format messages, dates, and numbers with Java
This chapter is about creating applications that adapt to change. What happens if a user enters invalid data on a web page, or our connection to a database goes down in the middle of a sale? How do we ensure rules about our data are enforced? Finally, how do we build applications that can support multiple languages or geographic regions?
In this chapter, we will discuss these problems and solutions ...