Is simpledateformat safe to use in the multithreaded program?



Is simpledateformat safe to use in the multithreaded program?..

Answer / Sreekant Singh Yadav

SimpleDateFormat is not thread-safe in Java. If you need to use it in a multithreaded environment, you should synchronize access to the same SimpleDateFormat instance or use a thread-safe alternative like SimpleDateFormatFormat.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What are MalformedURLException and UnknownHost Exceptions and whey they will be thrown?

2 Answers  


What is proper subset?

1 Answers  


What is the benefit of using enum to declare a constant?

1 Answers   Aspire, Infogain,


I have a String s = java; What is the output when I say s.replaceAll('j', 'k'); Also what is the value of s after replacing?

8 Answers   KPIT,


what are Hostile Applets?

1 Answers  


How will you measure that int takes up only 32 bits in memory?

2 Answers   Rolta,


What is a programming object?

1 Answers  


How to access a method that it declared as protected?

3 Answers  


What is string data?

1 Answers  


What is threaded programming and when is it used? : Java thread

1 Answers  


String is mutable or immutable?

3 Answers  


What are different exception types exceptions available in java ?

1 Answers  


Categories