Без явного синхронизированного блока:
Код: Выделить всё
public class SynTest {
public static void main(String []args){
final List list=new ArrayList();
final List synList=Collections.synchronizedList(list);
final Object o=new Object();
Thread tOne=new Thread(new Runnable(){
@Override
public void run() {
//synchronized(o){
for(int i=0;i
Подробнее здесь: [url]https://stackoverflow.com/questions/40930861/what-is-the-use-of-collections-synchronizedlist-method-it-doesnt-seem-to-syn[/url]
Мобильная версия