2) Using two statements, create an object bestDessertPlace, followed by an object bestIndianFood.


3)Given the code below, how many objects are created?
Restaurant bestIndianFood = new Restaurant();
Restaurant bestSushi = new Restaurant();
Restaurant bestCoffeeShop = new Restaurant();
int newRating;

4) Object bestSushi is of type Restaurant. Type a statement that sets bestSushi's name to "Sushi Station".

5) Type a statement to print bestCoffeeShop's name and rating.

Respuesta :

Answer:

Explanation:

The following code is written in Java and assumes that the available main class is the Restaurant class and that the other objects are all from the Restaurant class or a subclass of it.

2)  Restaurant bestdessertplace = new Restaurant();

    Restaurant bestindianfood = new Restaurant();

3) This snippet of code creates 3 individual objects which are bestIndianFood, bestSushi,  bestCoffeeShop.

4) bestSushi.name = "Sushi Station";

5) System.out.println(bestCoffeeShop.name + " " + bestCoffeeShop.rating);

ACCESS MORE
EDU ACCESS
Universidad de Mexico