.


:




:

































 

 

 

 


.




(thread) . , , , , . .

. Java : (implementing) (extending) . . . Java , . (, . start() ..). . . . , , .

. -, / static final (). , , , . -, . , , , . , ( ) . , , , new; , Runnable a = new Runnable(); . Thread. , .

. applet, :

CounterThread Example and Source code

, CounterThread Runnnable, Applet. init(), Cout Thread. this Thread, , . this CounterThread. . start(), run() CounterThread, CounterThread.run(). start() . , run() . , , run(), . run() Count, (sleep) 10 . , sleep . , , , . stop().

Java Java . , Java /, . .

 

 

.

, . , , , . ? , , , MS-DOS, . , , . , , , .

Java . . , Java. , , . , synchronized, :

public synchronized void decrement(){...}

( ) . , .

. , synchronized, , , . , . - sleep :

try{ Thread.sleep(500);}catch (InterruptedException ee){...}




:


: 2016-10-06; !; : 446 |


:

:

, .
==> ...

1748 - | 1612 -


© 2015-2024 lektsii.org - -

: 0.01 .