Why I can’t able to specify static type of methods in interface.
Is there any alternative to do this??
but I should use only inerface insted of abstract class.
/
Is there any problem in specifing acess specifier in interface?
I want to specify the events in Interface and that should be acessed only by implemented class so i want protected acess specifier to that event.
and I have certain function that can be make use of interface in another class in that case i can use public acess specifier.
I don’t know what language you’re taking about but I’ll answer as if in C#.
Why I can’t able to specify static type of methods in interface. Is there any alternative to do this??
It is because you can’t override static methods. What are you trying to achieve?
Members in interfaces are always public in C#. If you need to have other protection levels, use an abstract class. What would the purpose of protected events be if you can’t access them from the interface? It has nothing to do with the interface then (remember, the interface can’t have any code). If you are referring to that only implementing classes can raise the events, rest assured that they are the only ones that can raise them. Events are built that way – only the class itself can raise events. You can’t raise an event external from the class (except if you have a method on the class, raising the event).