Skip to content

Instantly share code, notes, and snippets.

@chermehdi
Created June 12, 2017 18:38
Show Gist options
  • Save chermehdi/596a74d9383be48c110615f7641feea9 to your computer and use it in GitHub Desktop.
Save chermehdi/596a74d9383be48c110615f7641feea9 to your computer and use it in GitHub Desktop.
List<Integer> list = new ArrayList<>();
// filling the list
for(int i = 0; i < 10; i++){
list.add(42);
}
System.out.println(list.get(0)); // it will print 42
// exercice : what will be the result of list.remove(42)
// hint it will throw an exception :D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment