java - Generics erasure and legacy code -
Many books have said that due to which general use of Java is erased, there is consistency with legacy code.
OK, very good but can someone show me some simple examples, where some common code interacts with the old Legacy code and vice versa?
Here's an example, which is not possible without type deformation Will be:
public static zero main (string [] args) {list & lt; String & gt; NewList = Legacy Method (); For (strings: newlive) {System.out.println (s); }} Legacy method of public static list () {list old list = new arrelist (); OldList.add ("A"); OldList.add ("b"); OldList.add ("C"); Return old; }
Comments
Post a Comment