package pkg11; public class Main { public static Main key; public static void main(String[] args) { key = new Main(); Thread1 t1 = new Thread1(key); Thread2 t2 = new Thread2(key); t1.start(); t2.start(); } } class Thread1 extends Thread{ Main key; public Thread1(Main key) { this.key = key; } //run method public void run() { synchronized(key) { for(int i=0; i
@HiruniBandara-bg7juАй бұрын
Great explanation! The visuals and step by step breakdown made it so easy to understand. Thanks for making learning so engaging! ❤