Java Practical No.21 & 22.pdf

  • Uploaded by: Meer Kukreja
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Java Practical No.21 & 22.pdf as PDF for free.

More details

  • Words: 78
  • Pages: 3
21.1) IMPLEMENT MULTITHREADING TO PERFORM SIMULTANEOUS PROCESSES. PROGRAM: class tdemo extends Thread { public void run() { try { for(int i=10;i>=1;i--) { System.out.println(i); sleep(550); } } catch(Exception e) { System.out.println(e); } } } class tdemo12 extends Thread { public void run() { try { for(int j=1;j<=10;j++) { System.out.println(j);

sleep(500); } } catch(Exception e) { System.out.println(e); } } } class tdemo123 { public static void main(String args[]) { tdemo12 t1=new tdemo12(); t1.start(); tdemo t=new tdemo(); t.start(); } }

OUTPUT:

Related Documents

Messenger-no21
April 2020 6
Golvur No21
October 2019 5

More Documents from "Meer Kukreja"