Ads by Google

Donate

If you like articles and you want an increase of them, please make a little donation. If you make a donation you can submit us by mail an argument for next articles!

Importo: 

add RSS

Add to MyYahoo!
Subscribe in NewsGator Online
Add to Newsburst
Add to Google
Add to My AOL
Add to Pluck
Subscribe in FeedLounge
Add to Windows Live
Add to NetVibes
Subscribe in Rojo
Subscribe in Bloglines
Add to MyMSN
Add to Plusmo for your cellphone
Add to PageFlakes
Add to Technorati

Subscribe to Blog

Follow us on Twitter

follow us

Manfriday blog gadget

Java


Creating runnable threads
Lunedì 19 Gennaio 2009 21:59

This is an example of how to manage threads in java. To make an istance of the object Thread you can give to constructor an object that implements the runnable interface.

So when the thread will start , it will execute the code in the run method of the associate istance

 

public class ThreadCreation implements Runnable {

     public ThreadCreation () {

       Thread ct = Thread.currentThread();

       ct.setName("main thread");

 

 


Ricerca personalizzata