Provides implementation information to the caller?

In JLS Capture Conversion , it discusses two ways to record a method signature reverse:

  • public static void reverse(List<?> list);
  • public static <T> void reverse(List<T> list);

    My question is why does the second provide implementation information to the caller? In particular, this example says that the second is undesirable because it provides implementation information to the caller.

+4
source share
1 answer

List <? > will return elements of type Object when iterates through a sheet. (ex: lyst.get (..))

The <T> list will return elements of type T.

, / .

0

All Articles