C# Multiple Choice Questions

Following quiz provides Multiple Choice Questions (MCQs) related to C#. 

csharp-image.png

You can check all the questions and given choice, and select one answer in your answersheet, once you have selected answer, you can click on "View Answer" to check if you are correct or not.

 


sizeof

typeof

&

Explanation:
& operator returns the address of an variable.

*

View answer

&

Explanation:
& operator returns the address of an variable.


0, 0, 0 4, 4, 4 8, 8, 8

Explanation: Since, with each value of of ‘i’ the value of ‘j’ is executed three times i.e
for i = 0, j = 0, 0, 0, i = 1, j = 2, 2, 2.

4, 4, 4  8, 8, 8   12, 12, 12

8, 8, 8  12, 12, 12  16, 16, 16

0, 0, 0  1, 1, 1  2, 2, 2

View answer

0, 0, 0 4, 4, 4 8, 8, 8

Explanation: Since, with each value of of ‘i’ the value of ‘j’ is executed three times i.e
for i = 0, j = 0, 0, 0, i = 1, j = 2, 2, 2.


Encapsulation is defined as the process of enclosing one or more items within a physical or logical package.

Encapsulation, in object oriented programming methodology, prevents access to implementation details.

Abstraction allows making relevant information visible and encapsulation enables a programmer to implement the desired level of abstraction.

All Of above

View answer

All Of above


web.config

global.asax

webapplication.vsdisco

assemblyinfo.cs

View answer

web.config


nestedif statement

#endif statement

switch case statement

None of the above

View answer

switch case statement



Each property consists of accessor as get and set

A property cannot be either read or write only

Properties can be used to store and retrieve values to and from the data members of a class

Properties are like actual methods which work like data members

View answer

Each property consists of accessor as get and set


StackOverflow

Division By Zero

Insufficient Memory

Incorrect Arithmetic Expression

View answer

Incorrect Arithmetic Expression



Occurs during Just-In-Time compilation.

Occurs at run-time.

Occurs during compilation.

Occurs during compilation.

View answer

Occurs at run-time.


That's it, we are done with Multiple choice Interview questions for C#