C# Programming - Interfaces - Discussion
Discussion Forum : Interfaces - General Questions (Q.No. 7)
7.
Which of the following statements is correct about an interface?
Discussion:
9 comments Page 1 of 1.
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!
From when is it allowed to an interface to contain implementation? Interface is a fully abstract class!
Corporal said:
8 years ago
Both A & C are correct
Ayushi said:
9 years ago
Option A is correct, we can implement one interface in another. Yes, we cannot define method but can implement.
Shashikant said:
9 years ago
No @Abhishek, an interface just cannot have any sort of implementation.
Abhishek Tiwari said:
9 years ago
Even A is also correct. One interface can be implemented in another interface.
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()
{
}
}
public interface MyInterface
{
void LoadData()
}
public class MyDataProvider:MyInterface
{
public void LoadData()
{
}
}
public class DataInfo:MyInterface
{
public void LoadData()
{
}
}
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.
Simon said:
1 decade ago
Agrees with @Vishnu.
Furthermore, [C] verb should be changed from "CAN" to "MUST", to be correct.
Furthermore, [C] verb should be changed from "CAN" to "MUST", to be correct.
Vishnu said:
1 decade ago
An interface can be implemented by multiple classes in the same program. This is true.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers