I get confused when I come across a generic method of this sort.
public static <T> T addAndReturn(T element, Collection<T> collection){
collection.add(element);
return element;
}
I cannot understand why <T> is required in this method.
Also, what is the difference between generic methods and the methods that use generics syntax?