Java
- Objects, by default, go in the heap
Builders
Enums
public enum Days = { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, … }
public enum Cereals = { FRUITLOOPS(10, 2.9), COCOAPUFFS(20, 3); }
final int tasteLevel; final double price;
Cereals(int tasteLevel, double price) { this.tasteLevel = tasteLevel; this.price = price; }