Java – the difference between “instanceof list” and “O instanceof list >“
•
Java
I don't think there is any difference between the following:
Object o = new LinkedList<Long>(); System.out.println(o instanceof List); System.out.println(o instanceof List<?>);
Is there an actual instance list When instanceof list cannot be used instead and vice versa?
Solution
No difference Wildcards are erased at compile time
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码