Data Types
摘要
Although we wrote a lot of code in the previous chapter, when designing the class, we used only the simplest data types, a few numeric ones and texts. In the JDK a lot of data types are declared for a multitude of purposes: for modeling calendar dates, for representing multiple types of numerics, and for manipulating texts, collections, data streams, files, database connections, and so on. Aside from the JDK, numerous libraries created by other parties are available that provide even more functionality. The data types provided by the JDK are fundamental types, the bricks every Java application is built from. Of course, depending on the type of application you are building, you might not need all of them. For example, I’ve never had the occasion to use the java.util.logging.Logger class. Most applications I have worked on were already set up by a different team when I came along, and they were using external libraries like Log4j or Logback or logging abstractions like SLF4J (covered in Chapter 9 ).