Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Define a class License. A License has a license number and an expiration date (I suggest using java.LocalDate, but there are other possibilities)....

  1. Define a class License. A License has a license number and an expiration date (I suggest using java.time.LocalDate, but there are other possibilities). Then do the following:
  2. (a) Think what it might mean for two License instances to represent the same real- world license. Write the Boolean equals method that takes another License as argument and returns true if the two Licenses are "equal" in this sense. The block comment for your method should explain how you are doing the comparison.
  3. (b) Write a Boolean method expired that returns true if the current date is after the expiration date of the License, otherwise false.
  4. (c) Define the class DriversLicense as a subclass of License. In addition to the properties of a License, a DriversLicense also has the state that issued the license (you can use a string for this).
  5. (d) Suppose that driver's licenses from different states may have the same license number. Override the equals method for DriversLicense to do the right thing when testing if two DriversLicenses are equal.
  6. (e) Define the class TruckDriversLicense that extends DriversLicense. Override the toString method to return a meaningful description of an instance.
  7. (f) Define the class FishingLicense which extends License. In addition to the properties of a License, a FishingLicense specifies what types of may be caught (you can use a string for this). Override the toString method.
  8. Illustrate all of these with a main method in a separate test class. 
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question