C# (C Sharp) MCQs with answers Page - 40

Here, you will find a collection of MCQ questions on C# (C Sharp). Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. A property________________.

  • (A) Should have a get method.
  • (B) Should have a put method.
  • (C) Should have both get and put methods.
  • (D) Should have either a get method or put method.

A

Admin • 833.24K Points
Coach

Q. An indexer________________.

  • (A) Enables us to access a property through index.
  • (B) Can have user-defined name.
  • (C) Is identified by its name.
  • (D) Cannot be overloaded.

A

Admin • 833.24K Points
Coach

Q. A namespace can contain___________.

  • (A) Classes
  • (B) Namespaces
  • (C) Classes and namespaces
  • (D) None of these.

A

Admin • 833.24K Points
Coach

Q. The alias should have

  • (A) Improve the readability of the code.
  • (B) Avoid name clashes.
  • (C) Saves you typing out very long strings.
  • (D) All the above.

A

Admin • 833.24K Points
Coach

Q. In the case of a component,

  • (A) Reusability is possible.
  • (B) Code will be in IL format.
  • (C) The extension is dll.
  • (D) All the above.

A

Admin • 833.24K Points
Coach

Q. In case of components and namespaces,

  • (A) Several classes may be present in a component.
  • (B) Classes contained in different source files may be part of same namespace.
  • (C) Classes contained in a source file may be from different namespaces.
  • (D) All the above.

A

Admin • 833.24K Points
Coach

Q. In the case of access modifiers___________.

  • (A) Private and protected access modifiers can be specified for a class.
  • (B) Public access modifier can be specified for a class.
  • (C) The scope of the internal access modifier is the namespace.
  • (D) None of these.

A

Admin • 833.24K Points
Coach

Q. The size of integer is___________.

  • (A) 8 bits
  • (B) 16 bits
  • (C) 32 bits
  • (D) 64 bits

A

Admin • 833.24K Points
Coach

Q. An instance of a value type variable is allocated memory on_______.

  • (A) Stack
  • (B) Heap
  • (C) Both a&b
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. An instance of a reference type variable is allocated memory on_______.

  • (A) Stack
  • (B) Heap
  • (C) Both a&b
  • (D) None of these

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ