java.text."=SimpleDateFormat nicht thread-sicher

Synchronization

Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally

Die obige Zeile ist bereits in der JavaDoc von " = SimpleDateFormat-Klasse.

Bedeutet es, dass wir sollten nicht das " = SimpleDateFormat-Objekte als Statisch.

Und Wenn wir es schaffen als statische, also überall, wo wir sind mit diesem Objekt, das wir halten müssen, um es in Synchronisierten Block.

InformationsquelleAutor Sunny Gupta | 2012-05-02
Schreibe einen Kommentar