Advance Java coaching, all programming language at TCCI, Java Course, Java Course In Satellite - Bopal Ahmedabad, Java Language in Bopal and Satellite, learn java online at TCCI

Thread in Java – TCCI

Thread is the most important part for concurrent execution.

Thread is the light wait process that means one process can be divided in to small small threads which will execute concurrently for fast execution of tasks.

All Java programs have at least one thread, known as the main thread, which is created by the JVM at the program’s start, when the main() method is invoked with the main thread. In Java, creating a thread is accomplished by implementing an interface and extending a class. Every Java thread is created and controlled by the java.lang.Thread class.

A Thread class extends Object class and implements Runnable interface. The one advantage of using Runnable interface over Thread class, is that the class which implements Runnable interface can extend one class or implement multiple interfaces which is not possible by extending thread class.

Example

  1. classMulti extends Thread{  
  2. publicvoid run(){  
  3. out.println(“thread is running…”);  
  4. }  
  5. publicstatic void main(String args[]){  
  6. Multi t1=newMulti();  
  7. start();  
  8. }  
  9. }  

TCCI Computer Coaching Institute teach Thread in Java in Bopal and Satellite in Ahmedabad.

You can Join Programming Language Course at TCCI. Online Coaching is also available.

For more information about Computer Courses at TCCI.

Visit us @ http://tccicomputercoaching.com/

Call us @ 98256 18292

Leave a comment