Alex Rivera | Logout

Why can't I declare a public method in an interface?

Asked 2011-04-20T16:13:16.397
33

Why doesn't the compiler like that I declare a public method in a class interface (this caused the error I got here .NET Class Interface, Inheritance and Library: error does not implement interface member).

Is it just because of syntax or because of something more fundamental ?

OK it's implicit but why would it hurt to make it explicit ?

Edit
Report

1 Answer

2

Check this blog post by Eric Lippert.

Thought it is for constants, I think this is what language designers were thinking why not to permit Public in interface.

answered 2011-04-25T01:35:29.563

Your Answer