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

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. What is the proper header for a class that intends to use an interface.

  • (A) class MyCalss {IFace
  • (B) class MyClass : IFace
  • (C) class MyClass ; IFace
  • (D) class MyClass IFace

A

Admin • 833.24K Points
Coach

Q. In order for a class to use an interface, it must

  • (A) inherit the properties of the interface
  • (B) contain the same methods as the interface
  • (C) create an interface objects
  • (D) all of the above

A

Admin • 833.24K Points
Coach

Q. Every class directly or indirectly extends the______class.

  • (A) Console
  • (B) Drawing
  • (C) Object
  • (D) System

A

Admin • 833.24K Points
Coach

Q. The concept of composition specifies that you can.

  • (A) Reduce errors by remaining composed during programming
  • (B) Compose good code with C#
  • (C) Compose C# projects with different objects
  • (D) all of the above

A

Admin • 833.24K Points
Coach

Q. Polymorphism occurs when the methods of the child class.

  • (A) Are Virtual
  • (B) Have different return types and arguments than the parent class
  • (C) Maintain the same return type and arguments as the parent class, but implement it differently
  • (D) Override the parent class methods but maintain the implementation

A

Admin • 833.24K Points
Coach

Q. To output the value of multidimensional array, Console.WriteLines(___)

  • (A) myArray(1),(3);
  • (B) myArray{1}{3};
  • (C) myArray[1.3];
  • (D) myArray[1][3];

A

Admin • 833.24K Points
Coach

Q. The code public class B : A { }

  • (A) Defines a class that inherits the public and protected methods of A only
  • (B) Defines a class that inherits all the methods of A
  • (C) Errors
  • (D) Both A and B

A

Admin • 833.24K Points
Coach

Q. A method_____an exception when that method detects that a problem has occured.

  • (A) Trys
  • (B) Catches
  • (C) Throws
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. Exception objects are derived from the class.

  • (A) Try
  • (B) Catch
  • (C) Exception
  • (D) Event

A

Admin • 833.24K Points
Coach

Q. An abstract class

  • (A) may contain instance variables
  • (B) may contain constructors
  • (C) may extend another class
  • (D) All of the above

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