The Singleton Design Pattern In Java
Have you ever had to write a SINGLETON IN JAVA? They can be hard to get right - I had a few coding bugs while filming the video! There are also multiple different types between ENUM SINGLETONS, LAZY VS EAGER SINGLETONS, MULTI-THREADED DOUBLE CHECKED LOCKING SINGLETONS, the list goes on. Then there's the problem of preventing this design pattern from being broken, typically via REFLECTION. In this video, I'll go through the common cases for singletons and a few different sample implementations, going over the PROS AND CONS FOR DIFFERENT SINGLETONS. In the end, you want to make sure that the singleton you're writing covers you for the cases you need to defend against, whether that's multi-threaded use, reflection, cloning, serialization, or other things. Hopefully this video gives you some ideas to ponder the next time you need to write a singleton! I'm Will Tollefson, a guy who loves to NEVER STOP LEARNING and teach others what I've learned. If you're enjoying the content, please LIKE, SUBSCRIBE, and SHARE! VIDEO CHAPTERS: 0:00 Introduction 0:40 Enum Singleton 2:10 Eager Singleton With Static Field 6:28 Lazy Singleton With Static Field 8:54 Synchronized Lazy Singleton 9:55 Double Checked Locking Singleton 12:52 Bill Pugh Singleton

The Factory Design Pattern In Java

How I program C

CountDownLatch vs CyclicBarrier | Code example, Usecases,When to Use, Comparison | Java Concurrency

Singleton Pattern – Design Patterns (ep 6)

FAQ : Singleton Design Pattern with Java Enum | Best Practices & Easy Guide | @Java Techie

Virtual Threads in Java 21

What is Singleton Pattern in Java - How to achieve this?

7 Design Patterns EVERY Developer Should Know

Decorator Pattern – Design Patterns (ep 3)

Zig 2026: No-AI Policy, $670K Foundation, Left GitHub & Why Zig Isn’t 1.0 - Andrew Kelley Explains

Java Network Sockets + Virtual Threads = Cool!

Singleton Pattern - Design Patterns

5 Design Patterns That Are ACTUALLY Used By Developers

Optionals In Java - Simple Tutorial

Linus Torvalds: AI Is Changing Linux Fast

Annotations In Java Tutorial - How To Create And Use Your Own Custom Annotations

Revisiting Effective Java in 2019 by Edson Yanaga

Co-Creator of Haskell: Useless vs Useful Languages, Rust vs C, Functional Programming | Simon Jones

Observer Pattern – Design Patterns (ep 2)

