Question: in Java please Restaurant Location Inheritance Create a class named Restaurant that inherits from an existing Location class defined like this: (You do not need
in Java please

Restaurant Location Inheritance Create a class named Restaurant that inherits from an existing Location class defined like this: (You do not need to define Location.) Your constructor should accept three arguments: a Str ing containing the cuisine served by this restaurant, and two doubles latitude and longitude, in that order. You should pass the String "restaurant" and the latitude and longitude to the Locatio constructor. assert that passed cuisine String is not null. However, note that you do not need to validate the latitude and the longitude: the Location constructor car handle this. served by this restaurant, and two doubles latitude and longitude, in that order. You should pass the String "restaurant" and the latitude and longitude to the Location constructor. assert that passed cuisine String is not null. However, note that you do not need to validate the latitude and the longitude: the Location constructor can handle this. Provide a getter (but not a setter) for the cuisine following our usual naming convention, and override tostring so that it returns a String in the following format: "This restaurant serves (cuisine) food." Here's an example of how your class should work: 1 Restaurant restaurant = new Restaurant("thai", 40.1336631, -88.2628647); 2 System.out.println(restaurant.getType()); // prints "restaurant" 3 System.out.println(restaurant.getCuisine()) ; // prints "thai" 4 System.out.println(restaurant); // prints "This restaurant serves thai food
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
