Code: Select all
class C {public List<CharSequence> test(List<CharSequence> a){return new ArrayList<CharSequence>();}}
Code: Select all
//Variant 1
//class D extends C{
// public List test(List a){return new ArrayList();}}
//Variant 2
//class D extends C{
// public List<CharSequence> test(List<CharSequence> a){return new ArrayList<CharSequence>();}}
//Variant 3
//class D extends C{
// public List<String> test(List<String> a){return new ArrayList<String>();}}
Code: Select all
//Compiled
//class D extends C{
// public List test(List a){return new ArrayList();}}
If a method parameter has generic information, there can never be another method with the same signature BUT different generic information, either in the same class or super/subclass scope. The only exception is when one of method parameter does not include any generic information.