To call the methods with the same names but different data types for its args,
either define overloaded methods each with the desired data type
or use generics and define a class to handle the...
Type: Posts; User: Norm
To call the methods with the same names but different data types for its args,
either define overloaded methods each with the desired data type
or use generics and define a class to handle the...
Have you tried writing the code using generics? The code in post#1 does not use generics. Try rewriting the code to use generics.
For example:
public class MethodsExample<T> {
...
...
Are you talking about method overloading? Having multiple methods with the same name but different parameters?