C# Programming - Interfaces - Discussion

Discussion :: Interfaces - General Questions (Q.No.7)

7. 

Which of the following statements is correct about an interface?

[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.

Answer: Option C

Explanation:

No answer description available for this question.

Vishnu said: (Nov 16, 2012)  
An interface can be implemented by multiple classes in the same program. This is true.

Simon said: (Jul 9, 2013)  
Agrees with @Vishnu.

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

John said: (Jun 25, 2014)  
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: (Dec 1, 2014)  
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: (Jun 24, 2016)  
Even A is also correct. One interface can be implemented in another interface.

Shashikant said: (Jul 2, 2016)  
No @Abhishek, an interface just cannot have any sort of implementation.

Ayushi said: (Jul 29, 2016)  
Option A is correct, we can implement one interface in another. Yes, we cannot define method but can implement.

Corporal said: (May 17, 2017)  
Both A & C are correct

Vitya said: (Nov 5, 2017)  
@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:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.