Given a singleton class Employee with 2 methods int getSalary() void updateSalary(int increment)
Do I need to synchronize or lock both these functions or use atomic salary variable? If yes then the question is that in this way we would have to synchronize all the functions that we define in multithreaded environment. So, why not just make synchronized a standard as today no real world application would be single threaded?