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

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. Which of the following statements are correct about arrays used in C#.NET?
1. Arrays can be rectangular or jagged.
2. Rectangular arrays have similar rows stored in adjacent memory locations.
3. Jagged arrays do not have an access to the methods of System.Array Class.
4. Rectangular arrays do not have an access to the methods of System.Array Class.
5. Jagged arrays have dissimilar rows stored in non-adjacent memory locations.

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

A

Admin • 833.24K Points
Coach

Q. Which of the following statements are correct?
1. A struct can contain properties.
2. A struct can contain constructors.
3. A struct can contain protected data members.
4. A struct cannot contain methods.
5. A struct cannot contain constants.

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

A

Admin • 833.24K Points
Coach

Q. Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "ALL MEN ARE CREATED EQUAL";
String s2; s2 = s1.Substring(12, 3);
Console.WriteLine(s2);

  • (A) ARE
  • (B) CRE
  • (C) CR
  • (D) REA

A

Admin • 833.24K Points
Coach

Q. Which of the following statements are correct about exception handling in C#.NET?
1 If an exception occurs then the program terminates abruptly without getting any chance to recover from the exception. 2 No matter whether an exception occurs or not, the statements in the finally clause (if present) will get executed.
3 A program can contain multiple finally clauses.
4 A finally clause is written outside the try block.
5 Finally clause is used to perform cleanup operations like closing the network/database connections.

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

A

Admin • 833.24K Points
Coach

Q. Struct’s data members are ____________ by default.

  • (A) Protected
  • (B) Public
  • (C) Private
  • (D) Default

A

Admin • 833.24K Points
Coach

Q. Which of these can be overloaded?

  • (A) Constructors
  • (B) Methods
  • (C) Both a & b
  • (D) None of the mentioned

A

Admin • 833.24K Points
Coach

Q. Constructors are used to

  • (A) initialize the objects
  • (B) construct the data members
  • (C) both a & b
  • (D) None of the mentioned

A

Admin • 833.24K Points
Coach

Q. Exponential formatting character (‘E’ or ‘e’) converts a given value to string in the form of _______.

  • (A) m.dddd
  • (B) E+xxx
  • (C) m.dddd
  • (D) E+xxx

A

Admin • 833.24K Points
Coach

Q. The ______ are the Graphical User Interface (GUI) components created for web based interactions..

  • (A) Web forms
  • (B) Window Forms
  • (C) Application Forms
  • (D) None of the above

A

Admin • 833.24K Points
Coach

Q. Which of the following can be facilitated by the Inheritance mechanism?
1 Use the existing functionality of base class.
2 Overrride the existing functionality of base class.
3 Implement new functionality in the derived class.
4 Implement polymorphic behaviour.
5 Implement containership.

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

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