Guest User

Untitled

a guest
Oct 13th, 2019
70
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // traditional method
  2. ArrayList<String> list = new ArrayList<String>();
  3. list.add("A");
  4. list.add("B");
  5. list.add("C");
  6.  
  7. // one-line method
  8. ArrayList<String> list = new ArrayList<>(Arrays.asList("A","B","C"));
RAW Paste Data