6.2 Program Units in Java

You’ve already been working with various program units in Java. You write programs by combining new methods and classes with predefined ones available in the Java Application Programming Interface (also referred to as the Java API or Java class library) and in various other class libraries. Related classes are typically grouped into packages so that they can be imported into programs and reused. You’ll learn how to group your own classes into packages in Section 21.4.10. Java 9 introduces another program unit called modules, which we discuss in Chapter 36, Java Module System and Other Java 9 Features.

The Java API provides a rich collection of predefined classes that contain methods for performing common mathematical ...

Get Java How to Program, Early Objects, 11th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.