Home / C# Programming / Properties :: Discussion

Discussion :: Properties

  1. If Sample class has a Length property with get accessor then which of the following statements will work correctly?

  2. A.
     Sample m = new Sample(); 
     m.Length = 10;
    B.
     Sample m = new Sample(); 
     m.Length = m.Length + 20;
    C.
      Sample m = new Sample();
      int l;
      l = m.Length;
    D.
    Sample.Length = 20;
    E.
    Console.WriteLine(Sample.Length);

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    No answer description available for this question.


Be The First To Comment