Top 150+ Solved C# Programming MCQ Questions Answer

From 76 to 90 of 144

Q. Which of the following statements is correct about constructors in C#.NET?

a. A constructor cannot be declared as private

b. A constructor cannot be overloaded

c. A constructor can be a static constructor

d. None of the mentioned

  • d. None of the mentioned

Q. What is return type of constructors?

a. int

b. float

c. void

d. None of the mentioned

  • c. void

Q. Which method have same name as that of its class?

a. delete

b. class

c. constructor

d. None of mentioned

  • c. constructor

Q. Which of following statement are correct about functions?

a. C# allows a function to have arguments with default values

b. Redefining a method parameter in the method’s body causes an exception

c. C# allows function to have arguments of private type

d. Omitting the return type in method definition results into exception

  • a. C# allows a function to have arguments with default values

Q. Which of the following is the correct way to access all elements of the Queue collection created using the C#.NET code snippet given below? Queue q = new Queue(); q.Enqueue("Sachin"); q.Enqueue('A'); q.Enqueue(false); q.Enqueue(38); q.Enqueue(5.4);

a. IEnumerator e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);

b. IEnumerable e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);

c. IEnumerator e; e = q.GetEnumerable(); while (e.MoveNext()) Console.WriteLine(e.Current);

d. IEnumerator e; e = Queue.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);

  • a. IEnumerator e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);

Q. Which of the following statements is incorrect about delegate?

a. Delegates are reference types.

b. Delegates are object oriented.

c. Delegates are type-safe.

d. Only one method can be called using a delegate.

  • d. Only one method can be called using a delegate.

Q. What is a delegate?

a. A strongly typed function pointer.

b. A light weight thread or process that can call a single method.

c. A reference to an object in a different process.

d. An inter-process message channel.

  • a. A strongly typed function pointer.

Q. Which of the following is included in Visual Studio IDE?

a. Form Designer

b. Code Editor

c. Solution Explorer

d. All of the above

  • d. All of the above

Q. Which of the following is true about dispose() method?

a. This method is protected.

b. Its return type is int.

c. It accepts a float parameter.

d. All of the above.

  • a. This method is protected.
Subscribe Now

Get All Updates & News