Join date: Apr 12, 2022


Multithreading in Java

Multithreading is an important concept in Java Programming. Thread is a lightweight sub process and a small unit of a process. Multithreading is a process of executing multiple threads simultaneously. In java programming object of thread class represent a thread. Each thread has its own local variables, program counter and its lifetime. The Communication cost is low using thread.


- Life cycle of Thread

Whenever a Thread is alive it goes through several states.

Different states of a thread are:

• New state – Thread is in new state after instance of Thread class is created but before the invocation of start method. In this state the thread is not alive.

• Runnable state – The thread is alive in this state. After the invocation of start() method the thread comes in runnable state. The thread is yet not selected by the thread scheduler for running. Thread can come back to this state when it is waiting, sleeping, or coming back from blocked state. In this state a thread is waiting for the processor.

• Running state – Thread is in this state means it is currently executing. Whenever a scheduler selects a thread from runnable pool it comes in running state.

• Dead state –Whenever a run() method of a thread completes it goes in dead state. A thread which comes in dead state cannot run again.

• Blocked – Whenever a thread is waiting for resources which are with other thread then it is in blocked state.

- Thread Creation :

According to homework answers websites in Java programming an object of a thread class represents a thread.

HTML Tutorial: Overview

• HTML stands for Hypertext Markup Language. • Hypertext means linking web pages to together and the link is called Hypertext. • Markup language means a set of tags that tells the browser how structure the content to display. • The HTML tags describe the HTML document and each tag describes different document content. • HTML is not a case sensitive language. • Every tag has an start and end tag. • According to there are various advantages of HTML such as Easy to use and learn, Supported on almost every browser, Free(no need to buy any software).

More resources:

Java Tutorial: I/O Packages

Exception Handling

String in Java

Java Tutorial: Abstract Class

Tokens in Java



More actions