Startertutorials Blog
Tutorials and articles related to programming, computer science, technology and others.
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Java program for demonstrating multithreading

Suryateja Pericherla Categories: Threads. No Comments on Java program for demonstrating multithreading

Aim To write a program for demonstrating multithreading using Java.   Theory A thread is a separate flow of execution in a program. All Java programs by default contain a single thread called the “Main thread”. A thread contains a set of statements like a method in Java. The difference between thread and a method […]

Read the rest of this entry »

Java program to demonstrate life cycle of a thread

Suryateja Pericherla Categories: Threads. No Comments on Java program to demonstrate life cycle of a thread

In this article we will learn to implement a Java program to demonstrate life cycle of a thread. A Java program is provided below to illustrate life cycle of a thread.   Program is as follows: import java.util.*; class ChildThread implements Runnable { Thread t; ChildThread() { t = new Thread(this); System.out.println("Thread is in new […]

Read the rest of this entry »

Java program that creates three threads

Suryateja Pericherla Categories: Threads. No Comments on Java program that creates three threads

In this article we will learn to implement a Java program that creates three threads. A java program is provided below to create three threads.   First thread displays “Good Morning” every one second, the second thread displays “Hello” every two seconds and the third thread displays “Welcome” every three seconds.   Program is as […]

Read the rest of this entry »
Blogarama - Blog Directory