Question: What will be the result of the following code? class vacation { public string tripName; public string location; public void display ( ) { Console.WriteLine

What will be the result of the following code?
class vacation
{
public string tripName;
public string location;
public void display()
{
Console.WriteLine("We are going to spend {0} in {1} this year", tripName, location);
}
}
class Program
{
static void Main(string[] args)
{
vacation obj = new vacation();
obj.tripName = "Christmas break";
obj.location = "Miami Beach";
obj.display();
Console.ReadLine();
}
}
Group of answer choices
We are going to spend Christmas break in Miami beach this year
Syntax error
We are going to spend Christmas in Miami this year
We are going to spend {0} in {1} this year" Christmas break Miami Beach
executes successfully and prints nothing

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