Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following class definition, which statements will instantiate an object of this class? Choose all that apply. class Restaurant { private string name; private

Given the following class definition, which statements will instantiate an object of this class?
Choose all that apply.
class Restaurant {
private string name;
private int rating;
public Restaurant(){
this. name ="no name";
}
this. rating =0;
public Restaurant(string initwane, int initRating){
this. name = initwame;
this. rating = initRating;
}
}
Restaurantyour r = new Restaurant(5, "Chilli's");
Restaurant rest = new Restaurant("Taco Bell");
Restaurant tacoBell = Restaurant 0 ;
new Restaurant diner = Restaurant(0;
Restaurant diner = Restaurant("Taco Bell", 3);
new rr= Restaurant("Taco Bell", 3);
new Restaurant chillis = Restaurant 0 ;
none of these
String rest = new Restaurant("Taco Bell", 3);
new Restaurant rr = Restaurant("Chilli's",5);
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Supply Chain Management Strategy Planning and Operation

Authors: Sunil Chopra, Peter Meindl

6th edition

133800202, 978-0133800203

More Books

Students also viewed these General Management questions

Question

35 What are antitrust laws? (page 267)

Answered: 1 week ago