על ידי יונתן ש » 18 ינואר 2016, 04:25
על ידי עובד שם » 04 מאי 2014, 21:24
על ידי תם » 27 נובמבר 2011, 17:43
על ידי תם » 27 נובמבר 2011, 17:40
על ידי נדב מתכנת » 17 מאי 2011, 22:25
על ידי עומר » 11 מאי 2011, 13:38
public class Sync1 extends Thread{ private int m_value; public Sync1(int value){ m_value = value; } public synchronized void printValue(int iValue){ while(true){ System.out.println(iValue); } } public void run(){ printValue(m_value); } }
public class Sync2 extends Thread{ private Sync1 m_sync1; public Sync2(Sync1 sync1){ m_sync1 = sync1; } public void run(){ m_sync1.printValue(2); } }
public class ssss { public static void main(String[] args) { Sync1 sync11 = new Sync1(1); sync11.start(); Sync2 sync2 = new Sync2(sync11); sync2.start(); Sync1 sync12 = new Sync1(3); sync12.start(); }}
int[99]
על ידי ישעיהו » 01 אפריל 2011, 15:50
חזור למעלה