StringBuilder naleyży używać jesli zamierzamy concat wiele stringów, StringBuilder został wprowadzony od Javy5. StringBuffer to starsza wersja StringBuildera. StringBuffer trobi to samo jednak z punktu widzenia performance jest wolniejszy gdzyż jest thread safe Thread Safety in Java Thread safety in java is the process to make our program safe to use in multithreaded environment, there are different ways through which we can make our program thread safe. Synchronization is the easiest and most widely used tool for thread safety in java. Use of Atomic Wrapper classes from java.util.concurrent.atomic package. For example AtomicInteger Use of locks from java.util.concurrent.locks package. Using thread safe collection classes, check this post for usage of ConcurrentHashMap for thread safety. Using volatile keyword with variables to make every thread read the data from memory, not read from thread cache. Język Java również posiada słow...