Basic computer course, C programming language, Education, Engineering Course, Maths Coaching, online computer coaching, PGDCA course coaching, programming course, school computer coaching, training, Uncategorized, Web Design course

What-is-thread-in-java?tccicomputercoaching.com

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.

JAVA-THREAD1

All Java programs nhave 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. class Multi extends Thread{

2. public void run(){

3. System.out.println(“thread is running…”);

4. }

5. public static void
main(String args[]){

6. Multi t1=new Multi();

7. t1.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/computer-it-engineering-course/

Call us @ 98256 18292

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s