How must this code be changed to be thread-safe?
A. synchronize the log method
B. replace StringBuilder with StringBuffer
C. replace StringBuilder with just a String object and use the string concatenation (+=) within the log method
D. No change is necessary, the current MyLogger code is already thread-safe.
Answer:A
How must this code be changed to be thread-safe?
A. synchronize the log method B. replace StringBuilder with StringBuffer C. replace StringBuilder with just a String object and use the string concatenation (+=) within the log method D. No change is necessary, the current MyLogger code is already thread-safe.