C# Programming - Interfaces - Discussion

Discussion Forum : Interfaces - General Questions (Q.No. 7)
7.
Which of the following statements is correct about an interface?
One interface can be implemented in another interface.
An interface can be implemented by multiple classes in the same program.
A class that implements an interface can explicitly implement members of that interface.
The functions declared in an interface have a body.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
9 comments Page 1 of 1.

Vishnu said:   1 decade ago
An interface can be implemented by multiple classes in the same program. This is true.

Simon said:   1 decade ago
Agrees with @Vishnu.

Furthermore, [C] verb should be changed from "CAN" to "MUST", to be correct.

John said:   1 decade ago
The word program should be changed in option (C). Program really does not make any sense. Try multiple classes in the same library or project.

Mukund said:   1 decade ago
Even B is true.

public interface MyInterface
{
void LoadData()
}

public class MyDataProvider:MyInterface
{
public void LoadData()
{
}
}

public class DataInfo:MyInterface
{
public void LoadData()
{
}

}

Abhishek Tiwari said:   9 years ago
Even A is also correct. One interface can be implemented in another interface.

Shashikant said:   9 years ago
No @Abhishek, an interface just cannot have any sort of implementation.

Ayushi said:   9 years ago
Option A is correct, we can implement one interface in another. Yes, we cannot define method but can implement.

Corporal said:   8 years ago
Both A & C are correct

Vitya said:   8 years ago
@All people who said A is correct.

From when is it allowed to an interface to contain implementation? Interface is a fully abstract class!

Post your comments here:

Your comments will be displayed after verification.