Exercise: Interfaces

Questions for: Interfaces

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?
A:
12 bytes
B:
24 bytes
C:
0 byte
D:
8 bytes
Answer: B
No answer description is available. Let's discuss.
Which of the following can be declared in an interface?
  1. Properties
  2. Methods
  3. Enumerations
  4. Events
  5. Structures
A:
1, 3
B:
1, 2, 4
C:
3, 5
D:
4, 5
Answer: B
No answer description is available. Let's discuss.
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()
    { } 
}
A:
A function cannot be declared inside an interface.
B:
A subroutine cannot be declared inside an interface.
C:
A Method Table will not be created for class MyClass.
D:
MyClass is an abstract class.
Answer: E
No answer description is available. Let's discuss.
Ad Slot (Above Pagination)
Quiz