7.8 Programming Activity 1: Writing a Class Definition, Part 1

In this programming activity, you will write the methods for an Airport class. Then you will run a prewritten client program that instantiates several Airport objects, calls the methods that you have written, and displays the values of the objects’ data.

The Airport class has two instance variables: the airport code and the number of gates.

In this chapter’s Programming Activity 1 folder in the supplied code files, you will find multiple files. Copy these files to a folder on your computer. Note that all files should be in the same folder.

Load the Airport.java source file; you’ll notice that the class already contains some source code. The method names and APIs are described in ...

Get Java Illuminated, 5th 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.