Skip to content

Instantly share code, notes, and snippets.

@keegoo
Last active February 17, 2020 03:18
Show Gist options
  • Save keegoo/cce3d35d25e78e16637a0bd9a843b6f5 to your computer and use it in GitHub Desktop.
Save keegoo/cce3d35d25e78e16637a0bd9a843b6f5 to your computer and use it in GitHub Desktop.
// Collection and Map are interfaces.
// compare to Array and Map in other languages.
import java.util.Collection
import java.util.Map
// sample methods of Collection interface:
//
// add
// clear
// equals
// isEmpty
// iterator
// sample methods of Map interface:
//
// get(key)
// keySet()
// values()
// put(key, value)
// containsKey(value)
// containsValue(value)
// Set, List and Queue are child interfaces of Collection.
// ArrayList is resizable.
// LinkedList is implemented as a double linked list. add and remove on two ends are efficient.
//
// clear explanation on ArrayList and LinkedList
//
// https://www.programcreek.com/2013/03/arraylist-vs-linkedlist-vs-vector/
// java.util package
import java.util.Iterator;
import java.util.ArrayList;
import java.util.List;
import java.lang.Integer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment