Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 foodStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started