Grokking Java Interview Questions
0% completed
Type Erasure
A class named Product implements Comparable<Product>, and its source code declares one method. A second program lists the methods of the compiled class and prints two:
compareTo(Product), bridge = false compareTo(Object), bridge = true
Nobody wrote the second method. The compiler added it, and the reason is the same one that makes an ArrayList<String> and an ArrayList<Integer> objects of one class
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%