The syntax for declaring non-static general methods is the same as for static methods, but without the static : generic parameters are placed before the return type.
class Example { public <E> void method(E param) { } }
Non-static methods can also use the generic type parameter of the enclosing class, as shown below. They are not considered as general methods; a common method is a method that declares type parameters .
class Example<T> {
source share