Which of the following can implement an interface?
1.1,3
2.2,4
3.3,5
4.4only
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.
1.1,2
2.1,4,5
3.3,4
4.3 only
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();
1.Properties cannot be declared inside an interface.
2.This is a perfectly workable interface.
3.The properties in the interface must have a body.
4.Subroutine in the interface must have a body.
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?
1.12 bytes
2.24 bytes
3.0 bytes
4.8 bytes
Which of the following can be declared in an interface?1. Properties2. Methods3. Enumerations4. Events5. Structures
1.1,3
2.1,2,4
3.3,5
4.4,5
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.
1.1,2,3
2.2,4
3.3,5
4. None of the above.
Which of the following statements is correct about an interface used in C#.NET?
1.One class can implement only one interface.
2.In a program if one class implements an interface then no other class in the same program can implement this interface.
3. From two base interfaces a new interface cannot be inherited.
4.Properties can be declared inside an interface.
Which of the following statements is correct about an interface used in C#.NET?
1.If a class implements an interface partially, then it should be an abstract class.
2.A class cannot implement an interface partially.
3.An interface can contain static methods.
4.An interface can contain static data.
Which of the following statements is correct about an interface?
1.One interface can be implemented in another interface.
2.An interface can be implemented by multiple classes in the same program.
3.A class that implements an interface can explicitly implement members of that interface.
4.The functions declared in an interface have a body.
Which of the following statements is correct about Interfaces used in C#.NET?
1. All interfaces are derived from an Object class.
2.Interfaces can be inherited.
3.All interfaces are derived from an Object interface.
4. Interfaces can contain only method declaration.
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 } }
1.Class MyClass is an abstract class.
2.Class MyClass cannot contain instance data.
3.Class MyClass fully implements the interface IMyInterface.
4.The compiler will report an error since the interface IMyInterface is only partially implemented.
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() { } }
1. A function cannot be declared inside an interface.
2.A subroutine cannot be declared inside an interface.
3.A Method Table will not be created for class MyClass.
4.The definition of fun1() in class MyClass should be void IMyInterface.fun1().
Which of the following statements is correct?
1.When a class inherits an interface it inherits member definitions as well as its implementations.
2.An interface cannot contain the signature of an indexer.
3.Interfaces members are automatically public.
4.To implement an interface member, the corresponding member in the class must be public as well as static.