Question: Create a public class named Location. Location should define a single public constructor that accepts two fields: a latitude and longitude position, as double values,

Create a public class named Location. Location should define a single public constructor that accepts two fields: a latitude and longitude position, as double values, in that order. Your constructor should reject invalid latitude and longitude values by throwing anIllegalArgumentException. Valid longitude values are between -180.0 and 180.0, inclusive, while valid latitude values are between -90.0 and 90.0.
Provide getters (but not setters) for the latitude and longitude following our usual conventions.
Your class should also implement the IMovableLocation interface:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!