Last active
April 25, 2020 12:23
-
-
Save mhddurrah/41a839a32cf58172dc0ac77f015472b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.why; | |
public class Why { | |
public static void main(String[] args) { | |
Gen<A> gen = new Gen<>(); | |
gen.m(new A()); //eeeeeeeeee A | |
} | |
} | |
class A {} | |
class B extends A {} | |
class C extends A {} | |
class Gen<E> { | |
Test test = new Test(); | |
public void m(E e) { | |
test.test(e); | |
} | |
} | |
class Test { | |
public <E extends A> void test(E e) { | |
System.out.println("XXXXXXXXXX " + e.getClass().getSimpleName()); | |
} | |
public <E> void test(E e) { | |
System.out.println("eeeeeeeeee " + e.getClass().getSimpleName()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment