UrbanPro
true

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Thread Class In JAVA

D Subba Rao
05/02/2018 0 0

Thread Class: Thread class is the main class on which Java's Multithreading system is based. Thread class, along with its companion interface Runnable will be used to create and run threads for utilizing Multithreading feature of Java.

Constructors of Thread class:

  1. Thread ( )
  2. Thread (String str)
  3. Thread (Runnable r)
  4. Thread (Runnable r, String str)

You can create new thread, either by extending Thread class or by implementing Runnable interface. Thread class also defines many methods for managing threads. Some of them are:

Method

Description

setName()

to give thread a name

getName()

return thread's name

getPriority()

return thread's priority

isAlive()

checks if thread is still running or not

join()

Wait for a thread to end

run()

Entry point for a thread

sleep()

suspend thread for a specified time

start()

start a thread by calling run() method

0 Dislike
Follow 2

Please Enter a comment

Submit

Other Lessons for You

Quick Sort Algorithm
Choose the pivot (using the "median-of-three" technique); also, put the smallest of the 3 values in A, put the largest of the 3 values in A, and swap the pivot with the value in A. (Putting the smallest...

Pattern Matching Algorithms
Pattern Matching Algorithms: There are various algorithms used to implement the pattern matching problem. Some of them are: Brute Force. Boyer-Moore. Knuth-Morris-Pratt (KMP). Brute Force: ...

OOPS: Polymorphism
Polymorphism:Polymorphism (from the Greek meaning "having multiple forms") is the characteristic of being able to assign a different meaning or usage to something in different contexts - specifically,...

Depth First Traversal For A Graph
Depth First Traversal (or Search) for a graph is similar to Depth First Traversal of a tree. The only catch here is, unlike trees, graphs may contain cycles, so we may come to the same node again. To...

Object Oriented Programming Paradigm
Object Oriented Programming Paradigm: OOPS is a better way of solving problems in computers compared to the procedural language programming such as in C. oops is designed around the data being operated...
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more