Examples A simple example Slightly more, with instances Even more, with exception handling Not that these examples: Were compiled using the OpenJDK compiler version 1.8.0_171. Use public static variables to prevent certain compiler optimizations that obfuscate some points.