Friday, 16 December 2011

80.If Sample class has a Length property with get and set accessors then which of the following statements will work correctly?p

1.Sample.Length = 20;
2.Sample m = new Sample();
3.m.Length = 10;
4.Console.WriteLine(Sample.Length);
5.Sample m = new Sample();
6.int len;
7.len = m.Length;
8.Sample m = new Sample();
9.m.Length = m.Length + 20;
A.1, 3
B.2, 4, 5
C.4 only
D.3, 5
Answer: Option B