C# Properties Aptitude Questions and Answers | Set 1

C# Properties Aptitude Questions | Set 1: This section contains aptitude questions and answers on C# Properties.
Submitted by Nidhi, on April 10, 2020

1) There are following statements are given below, which of them are correct about properties in C#.NET?
  1. Normally, properties are used to set and get values in private members of the class.
  2. Properties cannot be overloaded.
  3. Properties can be overloaded.
  4. In the new version on C#.NET, properties are not supported.

Options:

  1. Only A
  2. Only C
  3. B and D
  4. A and C

2) Is it true, we can only create read-only properties in C#.NET?
  1. True
  2. False

3) What is the keyword is used to create read property in C#.NET?
  1. read
  2. getProp
  3. get
  4. readProp

4) What is the keyword is used to create write property in C#.NET?
  1. write
  2. put
  3. save
  4. set

5) There are following statements are given below, which of them are correct about properties in C#.NET?
  1. A property can be read and write simultaneously.
  2. A property can be either read or write-only.
  3. To create a write-only property we should use only to get accessor.
  4. To create a write-only property we should use only set accessor.

Options:

  1. Only A
  2. Only B
  3. A and D
  4. B and C





Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.