loop through all instances of enum java code example Example: java loop through enum for (Direction dir : Direction.values()) { // do what you want }