we often overload method sometime also overload constructor. is there anyway to reduce method overload using generic as a result we will create one generic method and call with different parameter different time from the application. can anyone please explain with sample code how to do it. is it possible at all.
we often overload method sometime also overload constructor. is there anyway to reduce method
Share
No, generic methods provide the same functionaility to different types.
It looks like you want different functionality for different types.
Polymorphism is the tool you need to use to achieve this, not generics.