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

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 • 802.91K Points
Coach

Q. Which of the following benefits do we get on running managed code under CLR?
1. Type safety of the code running under CLR is assured.
2. It is ensured that an application would not access the memory that it is not authorized to access.
3. It launches separate process for every application running under it.
4. The resources are Garbage collected.

  • (A) Only 1 and 2
  • (B) Only 2, 3 and 4
  • (C) Only 1, 3 and 4
  • (D) All of the above

A

Admin • 802.91K Points
Coach

Q. Which of the following jobs are done by Common Language Runtime?
1. It provides core services such as memory management, thread management, and remoting.
2. It enforces strict type safety.
3. It provides Code Access Security.
4. It provides Garbage Collection Services.

  • (A) Only 1 and 2
  • (B) Only 3 and 4
  • (C) Only 1, 3 and 4
  • (D) All of the above

A

Admin • 802.91K Points
Coach

Q. Which of the following statements are correct about a .NET Assembly?
1. It is the smallest deployable unit.
2. Each assembly has only one entry
point - Main(), WinMain() or DLLMain(). 3. An assembly can be a Shared assembly or a Private assembly.
4. An assembly can contain only code
and data.
5. An assembly is always in the form of an EXE file

  • (A) 1,2,3
  • (B) 2,4,5
  • (C) 1,3,5
  • (D) 1,2

A

Admin • 802.91K Points
Coach

Q. Which of the following statements are correct about JIT?
1. JIT compiler compiles instructions into machine code at run time.
2. The code compiler by the JIT compiler runs under CLR.
3. The instructions compiled
by JIT compilers are written in native code.
4. The instructions compiled
by JIT compilers are written in Intermediate Language (IL) code.
5. The method is JIT compiled even if it is not called

  • (A) 1, 2, 3
  • (B) 2,4
  • (C) 3,4,5
  • (D) 1,2

A

Admin • 802.91K Points
Coach

Q. Which of the following are parts of the .NET Framework?

Code:
1. The Common Language Runtime (CLR) 
2. The Framework Class Libraries
(FCL) 
3. Microsoft Published Web Services 
4. Applications deployed on IIS
5. Mobile Applications
  • (A) Only 1, 2, 3
  • (B) Only 1, 2
  • (C) Only 1, 2, 4
  • (D) Only 4,5

A

Admin • 802.91K Points
Coach

Q. In C#, a subroutine is called a ________.

  • (A) Function
  • (B) Metadata
  • (C) Method
  • (D) Managed code

A

Admin • 802.91K Points
Coach

Q. All C# applications begin execution by calling the _____ method.

  • (A) Class()
  • (B) Main()
  • (C) Submain()
  • (D) Namespace

A

Admin • 802.91K Points
Coach

Q. A _______ is an identifier that denotes a storage location

  • (A) Constant
  • (B) Reference type
  • (C) Variable
  • (D) Object

A

Admin • 802.91K Points
Coach

Q. _________ are reserved, and cannot be used as identifiers.

  • (A) Keywords
  • (B) literal
  • (C) variables
  • (D) Identifiers

A

Admin • 802.91K Points
Coach

Q. Boxing converts a value type on the stack to an ______ on the heap.

  • (A) Bool type
  • (B) Instance type
  • (C) Class type
  • (D) Object type