C MCQ Quiz Hub

Choose a topic to test your knowledge and improve your C skills

Which of the following statements is correct about the C#.NET code snippet given below? interface IMyInterface { void fun1(); int fun2(); } class MyClass: IMyInterface { void fun1() { } int IMyInterface.fun2() { } }





✅ Correct Answer: 4

Which of the following can be declared in an interface?1. Properties2. Methods3. Enumerations4. Events5. Structures





✅ Correct Answer: 2

A class implements two interfaces each containing three methods. The class contains no instance data. Which of the following correctly indicate the size of the object created from this class?





✅ Correct Answer: 2

Which of the following statements is correct about an interface used in C#.NET?





✅ Correct Answer: 4

Which of the following statements is correct about Interfaces used in C#.NET?





✅ Correct Answer: 2

Which of the following statements is correct about an interface used in C#.NET?





✅ Correct Answer: 2

Which of the following statements is correct about an interface?





✅ Correct Answer: 3

Which of the following statements are correct about an interface in C#.NET? 1. A class can implement multiple interfaces. 2. Structures cannot inherit a class but can implement an interface. 3. In C#.NET, : is used to signify that a class member implements a specific interface. 4. An interface can implement multiple classes. 5. The static attribute can be used with a method that implements an interface declaration.





✅ Correct Answer: 1

Which of the following statements is correct?





✅ Correct Answer: 3

Which of the following statements are correct about an interface used in C#.NET? 1. An interface can contain properties, methods and events. 2. The keyword must implement forces implementation of an interface. 3. Interfaces can be overloaded. 4. Interfaces can be implemented by a class or a struct. 5. Enhanced implementations of an interface can be developed without breaking existing code.





✅ Correct Answer: 2

Which of the following can implement an interface?





✅ Correct Answer: 2

Which of the following statements is correct about the C#.NET code snippet given below? interface IMyInterface { void fun1(); void fun2(); } class MyClass: IMyInterface { private int i; void IMyInterface.fun1() { // Some code } }





✅ Correct Answer: 4

Which of the following statements is correct about the C#.NET code snippet given below? interface IPerson { String FirstName { get; set; } String LastName { get; set; } void Print(); void Stock(); int Fun();





✅ Correct Answer: 2