1. A sealed class in C# means:
2. CSharp cannot be run without installing...
3. In C#, a subroutine is called a ________.
4. What is the result of the following code ? interface IFoo1 { void meth1(); } interface IFoo2 { void meth1(); } public class f : IFoo1, IFoo2 { void IFoo1.meth1() { Console.WriteLine("Hi1"); } void IFoo2.meth1() { Console.WriteLine("Hi2"); } public void meth1() { Console.WriteLine('Hi3'); } void Main() { IFoo1 f1 = new f(); IFoo2 f2 = new f(); f f3 = new f(); f1.meth1(); f2.meth1(); f3.meth1(); }
5. What is boxing in .Net?
6. Which type of control inherits from the Control class without graphical representation?
7. Consider this method. static void SetupHandler(OrderProcessor orderProcessor) { string itemName = 'Pluralsight Subscription'; // AddOrder is an event orderProcessor.AddOrder += (sender, e) => Console.WriteLine('Item: ' + itemName); } What will happen when the AddOrder event is subsequently raised?
8. What is an Object in Object Oriented Programming?
9. Which of the following are not C# value types?
10. Which of the following operators cannot be overloaded?
11. What is the main difference between the is and as operators?
12. How would you access the last two people in an array named People?
C# MCQs | Topic-wise