![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
hi, I need help on interface. I want something like interface, any class implements this interfaces HAS to do implement method / property declared in this interface. As there already many functions, I do not want to rewrite all of them. Can I somehow declare a method which does not care about fucntion parameter list? Any parameter list is fine for it, it only restrict the return type. I am not sure if that is possbile. thanks. Here is an smaple: Class A { pubic int F(int a) {... } } Class B { public int F(string s, a) {.. } } I want a interface like interface IA { int F(..); } so that Class A : IA Class B : IB won't complain. Thanks again. I suspect that the solution to your problem lies in finding a different |
#3
| |||
| |||
|
|
Tao wrote: hi, I need help on interface. I want something like interface, any class implements this interfaces HAS to do implement method / property declared in this interface. As there already many functions, I do not want to rewrite all of them. Can I somehow declare a method which does not care about fucntion parameter list? Any parameter list is fine for it, it only restrict the return type. I am not sure if that is possbile. thanks. Here is an smaple: Class A { pubic int F(int a) {... } } Class B { public int F(string s, a) {.. } } I want a interface like interface IA { int F(..); } so that Class A : IA Class B : IB won't complain. Thanks again. I suspect that the solution to your problem lies in finding a different pattern to the one you are suggesting. It is not clear from you email what you are trying to achieve over all. However, if one of my team was to come to me with this question, I would ask why they want to make this construct and then try and find a more stable way of solving their overall problem. AJ -- www.deployview.com www.nerds-central.com www.project-network.com |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |