a. Create an abstract Division class with fields for a companys division name and account number, and

Question:

a. Create an abstract Division class with fields for a company’s division name and account number, and an abstract display() method. Use a constructor in the superclass that requires values for both fields. Save the file as Division.java.

b. Create two subclasses named InternationalDivision and DomesticDivision. The InternationalDivision subclass includes a field for the country in which the division is located and a field for the language spoken; its constructor requires both. The DomesticDivision subclass includes a field for the state in which the division is located; a value for this field is required by the constructor. Save the files as InternationalDivision.java and DomesticDivision.java.

c. Write an application named Use Division that creates a Division reference. Ask the user whether a DomesticDivision or InternationalDivision object should be created. Prompt for appropriate values and assign a new subclass object to the Division reference. Then display the details of the created object. Save the file as UseDivision.java.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java Programming

ISBN: 9780357673423

10th Edition

Authors: Joyce Farrell

Question Posted: