Question: in java With regards to the program below: 1. Identify a build-in class used in the program. 2. Identify a method stub. 3. Identify where

in java

With regards to the program below:

1. Identify a build-in class used in the program.

2. Identify a method stub.

3. Identify where typecasting is taking place in the program. Is it implicit or explicit typecasting? Justify your answer.

4. How many objects are created?

5. How many object references are created?

import java.util.Scanner; class Restaurant { private String name; private double rating; public void setName(String restaurantName) { name = restaurantName; } public void setRating(double userRating) { rating = userRating; } public String getName() { return name; } public double getRating() { return rating; } public void print() { System.out.println("FIXME: print"); } } public class Question9 { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String name = scnr.nextLine(); int rate = scnr.nextInt(); Restaurant goodFood = new Restaurant(); Restaurant goodFoodDownTown = goodFood; Restaurant goodFoodNextBlock; goodFood.setName(name); goodFood.setRating(rate); System.out.print(goodFood.getName() + " is rated " + goodFood.getRating()); } }

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 Databases Questions!