Is there any difference between the following two declarations?
public> List search (C condition)
public List
No, there's no useful difference. The distinction could be simplified to the following.
<T> void m(T object)
void m(Object object)
Although with the first one could call this.<String>m(42)
and it wouldn't compile - but there's no value to that.
The value of a generic method comes when there is some relationship expressed by its type parameters, for example:
<T> T giveItBackToMe(T object) {
return object;
}
...
String s = giveItBackToMe("asdf");
Integer i = giveItBackToMe(42);
Or:
<T> void listCopy(List<T> from, List<? super T> to) {
to.addAll(from);
}
...
List<Integer> ints = Arrays.asList(1, 2, 3);
List<Number> nums = new ArrayList<>();
listCopy(ints, nums);