Know the answer? Post it. Somebody with the same question will find it here.
Raja TRank #685 · 3.5K reputationPosted Dec 20, 2015, 11:54 PM EST
0
Hello Ravi,
An interface looks like a class, but has no implementation. The only thing it contains are declarations of events, indexers, methodsand/or properties. The reason interfaces only provide declarations is because they are inherited by classes and structs, which must provide an implementation for each interface member declared. more details check out below links
Ravi PatelRank #439 · 5.7K reputationPosted Dec 21, 2015, 5:17 AM EST
0
Sir we can write like bellow
public interface Myinterface {
TKey Id { get; }
string UserName { get; set; } } }
but i am not getting what is purpose of writing like above
0
Rajeesh MenothRank #118 · 18.4K reputationPosted Dec 21, 2015, 4:19 PM EST
0
Hi,
Interface is mainly used for declaration purpose.Abstract is mainly used for modification.Abstract is faster than Interface but Multiple Inheritence we need Interface.
Francis SusaimichaelRank #466 · 5.4K reputationPosted Dec 23, 2015, 12:21 AM EST
0
public interface Myinterface { TKey Id { get; } string UserName { get; set; } }
but i am not getting what is purpose of writing like above
OK. As per the code, you are trying to create "Generic Interface". For generic type parameters, the out keyword specifies that the type parameter is covariant. You can use the out keyword in generic interfaces and delegates.
Below urls are give a detailed lookup int these topics:
Raja TRank #685 · 3.5K reputationPosted Dec 20, 2015, 11:54 PM EST
An interface looks like a class, but has no implementation. The only thing it contains are declarations of events, indexers, methodsand/or properties. The reason interfaces only provide declarations is because they are inherited by classes and structs, which must provide an implementation for each interface member declared. more details check out below links
Ravi PatelRank #439 · 5.7K reputationPosted Dec 21, 2015, 4:37 AM EST
{
TKey Id { get; }
string UserName { get; set; }
}
}
Raja TRank #685 · 3.5K reputationPosted Dec 21, 2015, 4:59 AM EST
Ravi PatelRank #439 · 5.7K reputationPosted Dec 21, 2015, 5:17 AM EST
{
TKey Id { get; }
string UserName { get; set; }
}
}
Rajeesh MenothRank #118 · 18.4K reputationPosted Dec 21, 2015, 4:19 PM EST
Francis SusaimichaelRank #466 · 5.4K reputationPosted Dec 23, 2015, 12:21 AM EST
{
TKey Id { get; }
string UserName { get; set; }
}
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts