Why it is necessary to add synchronized to method4, but not to method5?
You must be signed in to leave a comment
5 December 2020, 23:10
Hi Denys, requirement states use synchronized in method 5 if necessary . since I can't see u r code here we go. method 4 we used (sb.) = String Builder which is not thread safe . method 5 use new String Buffer() which is thread safe . only trying to help .