LTIMindtree interview question

How to make a system thread-safe in Java?