-
Notifications
You must be signed in to change notification settings - Fork 0
Java
Thomas Czogalik edited this page Apr 23, 2019
·
19 revisions
- Java is pass-by-value!
- volatile vs static variables
- what does serialization of an object mean?
- nested classes
- visibility and access of member
- Generics and Collections
- Streams
-
JavaBean is just a standard
- All properties private (use getters/setters)
- A public no-argument constructor
- Implements Serializable.
-
- HashMap makes absolutely no guarantees about the iteration order. It can (and will) even change completely when new elements are added.
- TreeMap will iterate according to the "natural ordering" of the keys according to their compareTo() method (or an externally supplied Comparator). Additionally, it implements the SortedMap interface, which contains methods that depend on this sort order.
- LinkedHashMap will iterate in the order in which the entries were put into the map
-
Adding duplicate to set:
- In the case of HashMap, it replaces the old value with the new one.
- In the case of HashSet, the item isn't inserted.