header-logo.png GKINDEX

Java Thread class

We have an inbuilt class in java, which is named as Thread under the package of java.lang, Java Thread class helps to create/span a new Thread with in the Java application.

The following are the few methods covered from Java Thread class.

  • start() method, which helps to create a new thread.

  • sleep() method, which helps to stop the thread execution for certain amount of time.

  • join() method, which helps to wait current execution thread until the completion of other thread.

  • interrupt() method, which helps to interrupt the execution of a specific thread.

  • isAlive() method , which helps to check whether thread is currently running or completed the execution.

  • Share