Microsoft
98-361 · Question #382
You are reviewing a C# program that contains the following class: public class Rectangle { public double Length {get; set;} public double Width { get; set; } } The program executes the following…
The correct answer is C. 30. See the full explanation below for the reasoning.
Question
You are reviewing a C# program that contains the following class:
public class Rectangle { public double Length {get; set;} public double Width { get; set; } } The program executes the following code as part of the Main method:
Rectangle r1, r2; r1 = new Rectangle { Length = 10.0, Width = 20.0 }; r2 = r1; r2.Length = 30; Console.WriteLine(r1.Length); What will be the output when this code is executed?
Options
- A10
- B20
- C30
- D40
How the community answered
(52 responses)- A10% (5)
- B2% (1)
- C83% (43)
- D6% (3)
Community Discussion
No community discussion yet for this question.