Why are generics declared as part of a method? For instance, when creating a method that uses generics, the generics must be included after the method modifiers:
public static <T, K> void delete(AbstractDao<T, K> dao)
The generics portion of a method is not shown as part of a method declaration. According to java documentation, methods contain the following items:
Modifiers—such as public, private, and others you will learn about later.
The return type—the data type of the value returned by the method, or void if the method does not return a value.
The method name—the rules for field names apply to method names as well, but the convention is a little different.
The parameter list in parenthesis—a comma-delimited list of input parameters, preceded by their data types, enclosed by parentheses, (). If there are no parameters, you must use empty parentheses.
Reference: https://docs.oracle.com/javase/tutorial/java/javaOO/methods.html