Question: Given this class definition: class Point3D { double x; double y; double z; public void SetLocation(double x = 0, double y = 0, double z

Given this class definition:

class Point3D { double x; double y; double z;

public void SetLocation(double x = 0, double y = 0, double z = 5) { this.x = x; this.y = y; this.z = z; } public override string ToString() { return $"{x}, {y}, {z}"; } }

What will be printed when the code below is run? Point3D point = new Point3D(); point.SetLocation(1); Console.WriteLine(point.ToString());

Options:

a.

1, 0, 5

b.

1, 1, 1

c.

1, 1, 0

d.

0, 0, 5

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!