Interfaces - General Questions Online Exam Quiz
Interfaces - General Questions GK Quiz. Question and Answers related to Interfaces - General Questions. MCQ (Multiple Choice Questions with answers about Interfaces - General Questions
Which of the following can be declared in an interface?
Options
A : 1, 3
B : 1, 2, 4
C : 3, 5
D : 4, 5
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?
Options
A : 12 bytes
B : 24 bytes
C : 0 byte
D : 8 bytes
Which of the following statements is correct about an interface used in C#.NET?
Options
A : One class can implement only one interface.
B : In a program if one class implements an interface then no other class in the same program can implement this interface.
C : From two base interfaces a new interface cannot be inherited.
D : Properties can be declared inside an interface.
Which of the following statements is correct about Interfaces used in C#.NET?
Options
A : All interfaces are derived from an Object class.
B : Interfaces can be inherited.
C : All interfaces are derived from an Object interface.
D : Interfaces can contain only method declaration.
Which of the following statements is correct about an interface used in C#.NET?
Options
A : If a class implements an interface partially, then it should be an abstract class.
B : A class cannot implement an interface partially.
C : An interface can contain static methods.
D : An interface can contain static data.
Which of the following statements is correct about an interface?
Options
A : One interface can be implemented in another interface.
B : An interface can be implemented by multiple classes in the same program.
C : A class that implements an interface can explicitly implement members of that interface.
D : The functions declared in an interface have a body.
Which of the following statements are correct about an interface in C#.NET?
Options
A : 1, 2, 3
B : 2, 4
C : 3, 5
D : None of the above.
Which of the following is the correct implementation of the interface given below?
Options
A : class MyClass { double MyFun(Single i) as IMyInterface.MyFun { // Some code } }
B : class MyClass { MyFun (Single i) As Double { // Some code } }
C : class MyClass: implements IMyInterface { double fun(Single si) implements IMyInterface.MyFun() { //Some code } }
D : class MyClass: IMyInterface { double IMyInterface.MyFun(Single i) { // Some code } }
Which of the following statements is correct?
Options
A : When a class inherits an interface it inherits member definitions as well as its implementations.
B : An interface cannot contain the signature of an indexer.
C : Interfaces members are automatically public.
D : To implement an interface member, the corresponding member in the class must be public as well as static.
Which of the following statements are correct about an interface used in C#.NET?
Options
A : 1, 2
B : 1, 4, 5
C : 3, 4
D : 3 only
Attributes - General Questions more Online Exam Quiz
Enumerations - General Questions
Exception Handling - General Questions
Functions and Subroutines - General Questions
Inheritance - General Questions
Namespaces - General Questions
Polymorphism - General Questions