Skip to content

Instantly share code, notes, and snippets.

@ZephiroRB
Last active April 30, 2019 19:20
Show Gist options
  • Save ZephiroRB/d0ac12199a2bf4738d6d1611ae8ea61d to your computer and use it in GitHub Desktop.
Save ZephiroRB/d0ac12199a2bf4738d6d1611ae8ea61d to your computer and use it in GitHub Desktop.
List<String> animals = new ArrayList<>();
// Adding new elements to the ArrayList
animals.add("Lion");
animals.add("Tiger");
animals.add("Cat");
animals.add("Dog");
animals.add("Cuy");
System.out.println(animals);
//["Lion","Tiger","Cat", "Dog"]
List<String> animals_select = new ArrayList<>();
animals_select.add("Cat");
animals_select.add("Cuy");
//I need first those from the animal list (SORT)
//[ "Cat","Cuy", "Dog", "Lion","Tiger"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment