0

are the following two ways the same?

approach 1:

public static void process(List<? extends Foo> list) {
    for(Foo elem: list){
    }
}

approach 2:

public static <T extends Foo> void process(List<T> list) {
    for(Foo elem: list){
    }
}

if they are different, why? better if you can provide some examples

both code snippets should compile

0 Answers0