C# Programming :: Interfaces
-
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() { } }
-
Which of the following can be declared in an interface?
- Properties
- Methods
- Enumerations
- Events
- Structures
-
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?
-
Which of the following statements is correct about an interface used in C#.NET?
-
Which of the following statements is correct about Interfaces used in C#.NET?
-
Which of the following statements is correct about an interface used in C#.NET?
-
Which of the following statements is correct about an interface?
-
Which of the following statements are correct about an interface in C#.NET?
- A class can implement multiple interfaces.
- Structures cannot inherit a class but can implement an interface.
- In C#.NET, : is used to signify that a class member implements a specific interface.
- An interface can implement multiple classes.
- The static attribute can be used with a method that implements an interface declaration.
-
Which of the following is the correct implementation of the interface given below?
interface IMyInterface { double MyFun(Single i); }
-
Which of the following statements is correct?
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.
|
E.
Interfaces cannot be inherited.
|
A.
|
B.
|
C.
|
D.
|
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.
|