hi friends
I have an interface that is implemented by 100 classes, if I add a method to the interface will my classes compile? How can I fix any errors?
:D
Printable View
hi friends
I have an interface that is implemented by 100 classes, if I add a method to the interface will my classes compile? How can I fix any errors?
:D
Hi,
All the implementing classes will not compile. An interface is a contractual obligation. By implementing that interface you are guaranteeing that your class will fulfill its contractual obligation. If you add a new method to an interface then, by definition, all classes implementing that interface will have to implement the new method.
Regards
Nikhil Rattan
lets say you have an interface [B]IInterface[/B] which is implemented by 100 classes.
Now u wana add a method to the interface but not all of the implemented classes need to add the method.
Create another interface lets say
[B]ISubInterface[/B] implements [B]IInterface[/B]
Now use any one depending on your requirement.
There is no other way to fix ur problem:)
hi Masif,
small correction, an interface can only extend another interface but an interface can not implement another interface.