Core Java Tutorials


Introduction

Java Hello World

Java Compilation

JDK New Features

JVM Architecture

Java OOPs Concepts

Java Package

Array

Exception Handling

String

Immutable Class

File Handling

Serialization

MultiThreading

Volatile

Concurrent Package

Collection

Collection Internal

Generics

Cloning

Reflection In Java

Annotation

Class Loader

Java Inner classes

Garbage Collector

JDBC

References In Java

Heap Dump & Thread Dump

Thread sleep ,join , yield in Java


sleep is a static method of Thread class and causes the suspension of the thread for specified period of time.

 sleep() method

join() is a non static method of Thread class and waits at most specified millis milliseconds for this thread to die. A timeout of 0 means to wait forever. join implementation uses a loop of wait calls conditioned on isAlive method of Thread class. As a thread terminates the notifyAll method is invoked. It is recommended that applications not use wait,notify, or notifyAll on Thread instances.

 join() method