Properties

Q1: If Sample class has a Length property with set accessor then which of the following statements will work correctly?

A
Sample m = new Sample(); 
int l;
l = m.Length;

B
Sample m = new Sample(); 
m.Length = m.Length + 20;

C
Sample.Length = 20;

D
Console.WriteLine (Sample.Length);

E
Sample m = new Sample(); 
m.Length = 10;

ANS:E -

Sample m = new Sample(); 
m.Length = 10;

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.