fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. LinkedList<String> compras = new LinkedList<String>();
  13. LinkedList<String> linkedEventos = new LinkedList<String>();
  14.  
  15. compras.add("compra1");
  16. compras.add("compra2");
  17. linkedEventos.add("linkedevento1");
  18. linkedEventos.add("linkedevento2");
  19.  
  20. System.out.println(compras);
  21. System.out.println(linkedEventos);
  22.  
  23. linkedEventos = compras;
  24. compras.add("compra3");
  25.  
  26. System.out.println(compras);
  27. System.out.println(linkedEventos);
  28. }
  29. }
Success #stdin #stdout 0.05s 711168KB
stdin
Standard input is empty
stdout
[compra1, compra2]
[linkedevento1, linkedevento2]
[compra1, compra2, compra3]
[compra1, compra2, compra3]