Interview Q&A / Object-Oriented Programming
Object-Oriented Programming interview questions
The four pillars, interfaces, abstract classes and design basics.
Prefer rapid revision? Practise Object-Oriented Programming short interview answers →
- How do you make a Singleton thread-safe in Java?
Use eager initialisation, the holder class idiom, or an enum. If you need lazy creation with double-checked locking, the field must be volatile.
IntermediateQuick answer1 min read