What is an interface in C# ?
An interface in C# contains only signatures of methods, properties, events and indexers but not implementations.
An interface in C# cannot contain data members or variable declarations but only un-implemented methods are allowed.
An interface is similar to a class with un-implemented methods and no data members or variables are allowed including constants and read only variables . For an interface we cannot create an instance or an object.
All the above options are correct.
All the above options are correct .
See the below given sample , which contains only method prototypes and no definitions .
public interface IStudent
int GetRank(int studentId );
Back To Top