fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. class Ideone
  7. {
  8. class Abc {}
  9.  
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. List<Abc> a = new ArrayList<>();
  13. Object b = a;
  14. List<Ideone> c = (List<Ideone>)b;
  15.  
  16. c.add(new Ideone());
  17.  
  18. // System.out.println(a.get(0).getClass().getName());
  19. }
  20. }
Success #stdin #stdout 0.08s 32492KB
stdin
Standard input is empty
stdout
Standard output is empty