Top 150+ Solved C# Programming MCQ Questions Answer
Q. Which of the following statements is correct about constructors?
a. If we provide a one-argument constructor then the compiler still provides a zeroargument constructor.
b. Overloaded constructors have the same name as the class name
c. Overloaded constructors cannot use optional arguments.
d. If we do not provide a constructor, then the compiler provides a zero-argument constructor.
Q. Which of the following statements is correct?
a. There is one garbage collector per program running in memory.
b. There is one common garbage collector for all programs.
c. An object is destroyed by the garbage collector when only one reference refers to it.
d. We have to specifically run the garbage collector after executing Visual Studio.NET.
Q. Which one of the following statements is correct?
a. Array elements can be of integer type only.
b. The rank of an Array is the total number of elements it can contain.
c. The length of an Array is the number of dimensions in the Array.
d. The default value of numeric array elements is zero.
Q. If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two references?
a. s1 is s2
b. s1=s2
c. s1==s2
d. s1.Equals(s2)
Q. Which of the following statements is correct about an Exception?
a. It occurs during compilation.
b. It occurs during linking.
c. It occurs at run-time.
d. It occurs during Just-In-Time compilation.