Back
After reading Hidden Features of C# I wondered, What are some of the hidden features of Java?
Double Brace Initialization took me by wonder a few months ago when I first saw it, never learned of it before.
ThreadLocals are typically not so generally known as a way to save per-thread state.
Since JDK 1.5 Java has had remarkably well implemented and robust concurrency mechanisms beyond just locks, they live in java.util.concurrent and a particularly impressive example is the java.util.concurrent.atomic subpackage that includes thread-safe primitives that perform the compare-and-swap operation and can map to original native hardware-supported transcriptions of these operations.
31k questions
32.8k answers
501 comments
693 users