Question: a. Create an abstract Division class with fields for a companys division name and account number, and an abstract display() method. Use a constructor in

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.

Step by Step Solution

3.42 Rating (174 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a b c public abstract class Division private String div... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!