Senior
1
class Task { private static int counter = 0; public static void main(String[] args) throws Exception { var thread1 = new Thread(() -> increase()); var thread2 = new Thread(() -> increase()); thread1.start(); thread2.start(); thread1.join(); thread2.join(); System.out.println(counter); } private static void increase() { for (int i = 0; i < 5000; i++) { counter++; } } }
Компании, где спрашивали
сербская компания