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

/java/java-genericsPrevious             Next

Thread in Java

A thread is a flow of execution through the process code, with its own program counter that keeps track of which instruction to execute next, system registers which hold its current working variables, and a stack which contains the execution history. Using multiple thread we can perform multi tasking in java. Means more than one programs can execute parallel. So in java we can perform multiple tasks using single java program , by dividing a programs into number of threads and one thread will be able to perform one individual task. So in java a thread comprises following things.
 1. Thread Id
 2. Program counter
 3. Java Stack


 Java main thread:-
/java/java-genericsPrevious             Next