f1lam3ntx0

Untitled

Apr 2nd, 2020 (edited)
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. ===LIst practice on anonymous window===
  2.  
  3.  
  4. List <Integer> ls1 = new List <Integer>();
  5. ls1.add(1);
  6. ls1.add(2);
  7. ls1.add(2);
  8. ls1.add(123);
  9.  
  10.  
  11. List <Integer> ls2 = new List <integer> (ls1);
  12. System.debug(ls2);
  13.  
  14. set <Integer> s1 = new set <Integer> ();
  15. s1.add(12);
  16. s1.add(23);
  17.  
  18. public List <integer> ls = new List <Integer> (s1);
  19.  
  20. system.debug(ls);
  21.  
  22. public set <integer> s2 = new set <integer> ();
  23.  
  24. s2.add(11);
  25. s2.add(22);
  26. s2.add(33);
  27.  
  28. Public List <integer> Ls11 = new List <integer> ();
  29. Ls11.add(22);
  30. Ls11.add(121);
  31.  
  32. public List <integer> Ls22 = Ls11.clone();
  33.  
  34. system.debug(Ls22);
  35.  
  36. public set <integer> s11 = new set < integer> ();
  37. s11.add(12);
  38. s11.add(121);
  39. public List <integer> ls12 = new List <integer> (s11);
  40.  
  41. Boolean lsc = ls12.contains(121);
  42.  system.debug(lsc);
Add Comment
Please, Sign In to add comment