< prev index next >

langtools/test/tools/javac/generics/Nonlinear.java

Print this page

        

@@ -20,11 +20,11 @@
     // This code compiles, but produces a ClassCastException
     // when executed, even though there are no explicit casts in
     // the program.
 
     public static void main (String [] args) {
-        Integer x = new Integer (5);
+        Integer x = Integer.valueOf(5);
         String y = castit (x);
         System.out.println (y);
     }
 
     static <A,B> A castit (B x) {
< prev index next >