MSK Technologies

Home
Practice Programs
Java Programs Python Programs Java Quiz
Pages
Python Java Material PLSQL Material
Search A Job

Write a Thread suspend() program

  1. Home
  2. Java Programs

Write a Thread suspend() program

Write a Thread suspend() program

Program
class ThDemo  extends Thread
{
    public void run()  
    {    
        int x;
        for(x=1;x<=10;x++)
        {
            try
            {
                Thread.sleep(2000);
                System.out.println(x);
            }
            catch(Exception e)
            {
                System.out.println(e);
            }
        }
    }   
    
}
public class Main
{
    public static void main(String args[])
    {
        ThDemo d1=new ThDemo();
        d1.start();
        d1.suspend();
        ThDemo1 d2=new ThDemo1();
        d2.start();
    }
}


Output:

1
2
3
4
5
6
7
8
9
10


Multi Threading In Java



More Questions


223 . Write a Java-program to print duplicate characters from the string ?
224 . Write a Java-program to print unique(distinct (or non-repeating characters) ) characters from the string ?
225 . Write a java program How to check if two strings are anagrams of each other?
226 . How to reverse a string in Java without using the reverse method ?
227 . How to count the occurrence of the given character in a string?
228 . How to check if a string is a palindrome?
229 . How to count the number of words in a given string sentence?
230 . How to reverse the words from the given string sentence?
231 . How to swap two strings without using the third variable?
232 . Write a java program to display message a 2sec time gap without using Multi Threading
233 . Write a java program to display message a 2sec time gap using Thread class


Interview Questions

Java Interview Questions

Python Interview Questions

Oracle Interview Questions

100 Most Asked Java Interview Questions and Answers

HR Interview Questions and Answers

Top 50 OOPS Interview Questions & Answers

Apply For The Job

Apply For Job

Java Material

Python Material

PLSQL Material

.Net Material

Java Practice Programs

400 Java Programs

Java Practice Programs

Write a Java program to convert seconds to hour, minute and seconds

Write a Java program to print the sum of two numbers

Write a Program to remove duplicate element in an array

Write a Java program to convert a decimal number to binary numbers

Write a Java Program to find largest and second largest in an array

Python Practice Programs

Write a python program to calculate average using python *args ?

Write a Python Program to Print the Fibonacci sequence.

Write a python program to convert uppercase strings and we want to convert them into lowercase strings and remove duplicates ?

Write a python program to find absolute value of a number in the list

Write a Python Program for cube sum of first n natural numbers?

Interview Questions

Java Interview Questions

Python Interview Questions

Oracle Interview Questions

100 Most Asked Java Interview Questions and Answers

HR Interview Questions and Answers

Top 50 OOPS Interview Questions & Answers

Java Quiz

Java Quiz - 22

Java Quiz - 21

Java Quiz - 9

Java Quiz - 10

Java Quiz - 23

Courses
Java Python PLSQL .Net ADO.Net About Us
Quick Links
Daily Use English Sentences Daily General Knowledge General Knowledge Latest Update Inventions and Inventors జనరల్ నాలెడ్జ్ General Knowledge Spoken English Spoken Hindi GK Hindi Telugu Facts Unknown Facts Psychology Facts Motivation Quotes విటమిన్ - సి,డి,ఇ,కె Android
Spiritual
రాధాకృష్ణ భగవద్గీత Motivation Quotes Slokas Talapatra Nidhi ఆధ్యాత్మిక భక్తి ప్రపంచం Sadhguru Sai Motivation Quotes గౌతమ బుద్ధుడు Bhagavad Gita Quotes
Newsletter

Dolor amet sit justo amet elitr clita ipsum elitr est.

© sateeshm, All Right Reserved. Designed By sateeshm
Home Help FQAs