View the step-by-step solution to:

Programming Activity 7-2 Guidance ================================= This activity builds upon the work done in activity 7-1. It requires you to...

Programming Activity 7-2 Guidance
=================================

This activity builds upon the work done in activity 7-1.
It requires you to create and work with a static class variable.
It also requires you to create toString() and equals() functions.

The framework comments provide detailed instructions.
Make sure you read and follow them.

Main class
----------
You will make changes to and compile Airport.java.
However, to run the program you run it from AirportClient.java.
This means that AirportClient.java must be the current opened source file in TextPad
when you choose to run the application.

Part 1
------
The static field countAirports is not a constant and should be private.

Part 2
------
Static fields are referenced by using the class name, rather than an object name.
To reference the static field countAirports, use Airport.countAirports.

Part 4
------
Since the getCountAirports() function references a static field, this
function must be declared as a static function (using the static keyword).

Part 5
------
The following example shows the format for the String returned by toString():
  Airport code: IAD; Number of gates: 30

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question