Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (harsha19111999):

Does anyone know about threads in JAVA?

OpenStudy (lyrae):

Yes. What's your question?

OpenStudy (harsha19111999):

I need to know how they are created and how they can be manipulated

OpenStudy (daenio):

The second way to specify what code a thread should run is by creating a class that implements java.lang.Runnable. The Runnable object can be executed by a Thread. To have the run() method executed by a thread, pass an instance of MyRunnable to a Thread in its constructor. Here is how that is done: Creating and Starting Java Threads - Tutorials - Jenkov.com tutorials.jenkov.com/java-concurrency/creating-and-starting-threads.html

OpenStudy (lyrae):

You'll find the basics in the tutorial posted by @Daenio. For further reading i recommend you to read this entire tutorial about java concurrency as well: http://docs.oracle.com/javase/tutorial/essential/concurrency/index.html You'll learn a lot of important and usefull things like synchronization, imutable objects, locks, and thread pools.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!