Last post Jul 22, 2014 12:30 PM by Siva Krishna Macha
Jul 22, 2014 10:43 AM|gaddamraju4u|LINK
hi i am new to c#
can any one clear my doubt
can interface contain abstract methods ?
actually i know that interface contain only function prototypes
Thanks in ADVANCE
Jul 22, 2014 10:55 AM|MetalAsp.Net|LINK
In the test, which took me 2 minutes to do, I got this error: "CS0106: The modifier 'abstract' is not valid for this item".
But don't take my word for it; take 2 minutes are run a test yourself.
Edit: And a quick google (which took less than a minute) revealed this informative page:
where it states: "Abstract method declarations are only permitted in abstract classes"
Jul 22, 2014 11:00 AM|Siva Krishna Macha|LINK
No - interfaces can't contain the abstract methods.
Interfaces can syntactically be described as "pure" abstract classes - without abstract keywords.
Jul 22, 2014 11:38 AM|gaddamraju4u|LINK
interfaces contain Property signatures
i am right
// Property signatures:
finally interface contain function prototypes and Property signatures.
is it contain any other objects ?
Jul 22, 2014 12:30 PM|Siva Krishna Macha|LINK
Yes, An interface contains only the signatures of
interface (C# Reference) from MSDN.
You might also feel this article interesting for learning more about interfaces:
Interfaces in C# (For Beginners)