You are on page 1of 95

Chat Log      C:\Users\chira\Documents\ChatLog Refresher Program _Java Full stack

_ C Programming _ Python_ _Batch1_ Virtual Training at NEC 2021_10_11 13_06.rtf

Naveen Kumar Mittal (to Everyone): 09:05: present mam


Monica (to Everyone): 09:24: class MyThread extends Thread {
String ss;
public MyThread(String S) {    ss=S; }
        public void run() {
for(int i=0;i<10;i++)
System.out.println(ss + " thread is running ... with Stage " + i);
    }
}
public class ThreadEx1 {
                public static void main(String [] args    ) {
MyThread t1 = new MyThread("t1");
MyThread t2 = new MyThread("t2");
t1.start();
t2.start();
       }
}

Naveen Kumar Mittal (to Everyone): 09:25: t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9

Saumya Vishwakarma (to Everyone): 09:25: t1 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 8
t2 thread is running ... with Stage 7
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9

Shipra Yadav (to Everyone): 09:25: t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9

Kushagra Gupta (to Everyone): 09:25: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t1 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 9
AMAN SAXENA (to Everyone): 09:25: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t2 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 9

APURV AGNIHOTRI (to Everyone): 09:25: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 9
Deep Shikhar Singh (to Everyone): 09:26: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9

Atul Gupta (to Everyone): 09:26: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
MAYANK KUMAR (to Everyone): 09:26: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9

Challa Bhavya (to Everyone): 09:26:


t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9

09:26

Atul Gupta to Everyone

t1 thread is running ... with Stage 0


t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9

K Prasanna Kumar (to Everyone): 09:27: t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 7
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 8
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9

Nagareddy Deepthi (to Everyone): 09:27: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
Mohit Rai (to Everyone): 09:27: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
Unnati (to Everyone): 09:27: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9

Ravi Pratap (to Everyone): 09:28: t1 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
shivendra gupta (to Everyone): 09:28: t1 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9

Harthik Ps (to Everyone): 09:28: t1 thread is running ... with Stage 0


t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9

Syed Ali Abbas (to Everyone): 09:29: t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
Akshay Singh (to Everyone): 09:30: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 8
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
Shivaksh Ahalawat (to Everyone): 09:32: t2 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9

Abhishek Kaushik (to Everyone): 09:32: t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9

Monica (to Everyone): 09:32: class MyThread implements Runnable {


String ss;
public MyThread(String S) {    ss=S; }
        public void run() {
for(int i=0;i<10;i++)
System.out.println(ss + " thread is running ... with Stage " + i);
    }
}
public class ThreadEx1 {
                public static void main(String [] args    ) {
          Thread t1 = new Thread(new MyThread("t1"));
          Thread t2 = new Thread(new MyThread("t2"));
          t1.start();
          t2.start();
       }
}

Naveen Kumar Mittal (to Everyone): 09:34: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
K Prasanna Kumar (to Everyone): 09:35: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9

Challa Bhavya (to Everyone): 09:35: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9

AMAN SAXENA (to Everyone): 09:35: t1 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 8
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9

Unnati (to Everyone): 09:35: t1 thread is running ... with Stage 0


t2 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9

Abhishek Kaushik (to Everyone): 09:35: t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 7
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 8
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9

MAYANK KUMAR (to Everyone): 09:36: t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t2 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 9
Akshay Singh (to Everyone): 09:36: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t2 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 9
Atul Gupta (to Everyone): 09:36: t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
Syed Ali Abbas (to Everyone): 09:36: t1 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 8
t2 thread is running ... with Stage 7
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
Nagareddy Deepthi (to Everyone): 09:36: t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
Harthik Ps (to Everyone): 09:36: t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 9

Saumya Vishwakarma (to Everyone): 09:36: t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9

Shipra Yadav (to Everyone): 09:36: t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 0
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 2
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t1 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t1 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t1 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t1 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9
t2 thread is running ... with Stage 9

Ravi Pratap (to Everyone): 09:36: t1 thread is running ... with Stage 0
t1 thread is running ... with Stage 1
t2 thread is running ... with Stage 0
t1 thread is running ... with Stage 2
t2 thread is running ... with Stage 1
t1 thread is running ... with Stage 3
t2 thread is running ... with Stage 2
t2 thread is running ... with Stage 3
t2 thread is running ... with Stage 4
t2 thread is running ... with Stage 5
t2 thread is running ... with Stage 6
t2 thread is running ... with Stage 7
t2 thread is running ... with Stage 8
t2 thread is running ... with Stage 9
t1 thread is running ... with Stage 4
t1 thread is running ... with Stage 5
t1 thread is running ... with Stage 6
t1 thread is running ... with Stage 7
t1 thread is running ... with Stage 8
t1 thread is running ... with Stage 9

Monica (to Everyone): 10:13: public class InternetBankingSystem {


public static void main(String[] args) {
Account accountObject = new Account();
Thread t1 = new Thread(new DepoThread(accountObject, 10000));
Thread t2 = new Thread(new DrawThread(accountObject, 2000));
Thread t3 = new Thread(new BalThread(accountObject));
t1.start(); t2.start(); t3.start();
} }
class Account { // the 'monitor'
int balance;
// if 'synchronized' is removed, the outcome is unpredictable
public synchronized void deposit(int deposit_amount) {
System.out.println("\nDeposit amount" + deposit_amount);
balance += deposit_amount; }
public synchronized void withdraw(int deposit_amount) {
System.out.println("\nWithdrawn amount" + deposit_amount);
balance -= deposit_amount; }
public synchronized void enquire() {
System.out.println("\nBalance=" + balance); }
}

Monica (to Everyone): 10:13: class DepoThread implements Runnable {


Account account; int amt;
public DepoThread(Account s, int a) {
account = s; amt = a; }
public void run() {
account.deposit(amt); }
}
class DrawThread implements Runnable {
Account account;    int amt;
public DrawThread(Account s, int a) {
account = s; amt = a; }
public void run() {
account.withdraw(amt); }
}
class BalThread implements Runnable {
Account account;
public BalThread(Account s) {
account = s;    }
public void run() {
account.enquire(); }
}

Naveen Kumar Mittal (to Everyone): 10:14:


Deposit amount10000

Withdrawn amount2000

Balance=8000
Deep Shikhar Singh (to Everyone): 10:14: Deposit amount10000

Withdrawn amount2000

Balance=8000

Akshay Singh (to Everyone): 10:14:


Deposit amount10000

Balance=10000

Withdrawn amount2000
Abhishek Rana (to Everyone): 10:15: Deposit amount10000

Balance=10000

Withdrawn amount2000

APURV AGNIHOTRI (to Everyone): 10:15:


Deposit amount10000

Balance=10000

Withdrawn amount2000
shivendra gupta (to Everyone): 10:15:
Deposit amount10000
Balance=10000

Withdrawn amount2000

Shipra Yadav (to Everyone): 10:15:


Deposit amount10000

Balance=10000

Withdrawn amount2000
Kushagra Gupta (to Everyone): 10:15: Deposit amount10000

Balance=10000

Withdrawn amount2000
Saumya Vishwakarma (to Everyone): 10:15: Deposit amount10000

Balance=10000

Withdrawn amount2000
Unnati (to Everyone): 10:15:
Deposit amount10000

Balance=10000

Withdrawn amount2000

Atul Gupta (to Everyone): 10:15: Deposit amount10000

Balance=10000

Withdrawn amount2000
Harthik Ps (to Everyone): 10:15:
Deposit amount10000

Balance=10000

Withdrawn amount2000
Nagareddy Deepthi (to Everyone): 10:15: Deposit amount10000

Balance=10000

Withdrawn amount2000
Ravi Pratap (to Everyone): 10:16: Deposit amount10000

Balance=10000

Withdrawn amount2000
Shivaksh Ahalawat (to Everyone): 10:16:
Deposit amount10000

Balance=10000

Withdrawn amount2000

AMAN SAXENA (to Everyone): 10:16: Deposit amount10000

Balance=10000

Withdrawn amount2000

Challa Bhavya (to Everyone): 10:16: Deposit amount10000

Balance=10000

Withdrawn amount2000
Akshay Singh (to Everyone): 10:16:
Deposit amount10000

Withdrawn amount2000

Balance=0
MAYANK KUMAR (to Everyone): 10:17:
Deposit amount10000

Balance=10000

Withdrawn amount2000
Abhishek Kaushik (to Everyone): 10:17: Deposit amount10000

Balance=10000

Withdrawn amount2000

Deep Shikhar Singh (to Everyone): 10:17: Balance=0

Withdrawn amount2000

Deposit amount10000
Akshay Singh (to Everyone): 10:17:
Deposit amount10000

Balance=0

Withdrawn amount2000
Unnati (to Everyone): 10:18:
Balance=0

Deposit amount10000

Withdrawn amount2000

MAYANK KUMAR (to Everyone): 10:18:


Withdrawn amount2000

Deposit amount10000

Balance=0

APURV AGNIHOTRI (to Everyone): 10:18:


Withdrawn amount2000

Deposit amount10000

Balance=0

Ravi Pratap (to Everyone): 10:18: Withdrawn amount2000


Deposit amount10000

Balance=0
After removing synchronized
K Prasanna Kumar (to Everyone): 10:18:
Deposit amount10000

Withdrawn amount2000

Balance=0
Shipra Yadav (to Everyone): 10:19:
Deposit amount10000

Withdrawn amount2000

Balance=0
Mohit Rai (to Everyone): 10:19:
Withdrawn amount2000

Deposit amount10000

Balance=0
shivendra gupta (to Everyone): 10:19:
Withdrawn amount2000

Deposit amount10000

Balance=0

AMAN SAXENA (to Everyone): 10:19:


Withdrawn amount2000

Deposit amount10000

Balance=0

Challa Bhavya (to Everyone): 10:19: Withdrawn amount2000

Deposit amount10000
Balance=0
Monica (to Everyone): 10:20: public class InternetBankingSystem {
public static void main(String[] args) {
Account accountObject = new Account();
Thread t1 = new Thread(new DepoThread(accountObject, 10000));
Thread t2 = new Thread(new DrawThread(accountObject, 2000));
Thread t3 = new Thread(new BalThread(accountObject));

Account accountObject2 = new Account();


Thread t12 = new Thread(new DepoThread(accountObject2, 50000));
Thread t22 = new Thread(new DrawThread(accountObject2, 3000));
Thread t32 = new Thread(new BalThread(accountObject2));
t12.start(); t22.start(); t32.start();
t1.start(); t2.start(); t3.start();
} }
Nagareddy Deepthi (to Everyone): 10:20: Withdrawn amount2000

Deposit amount10000

Balance=0
Saumya Vishwakarma (to Everyone): 10:20: Withdrawn amount2000

Deposit amount10000

Balance=0

Syed Ali Abbas (to Everyone): 10:21:


Deposit amount50000

Deposit amount10000

Withdrawn amount3000

Balance=10000

Balance=47000

Withdrawn amount2000
Piyush Shukla (to Everyone): 10:22:
Deposit amount10000
Balance=10000

Withdrawn amount2000

Monica (to Everyone): 10:23: public class InternetBankingSystem {


public static void main(String[] args) {
Account accountObject = new Account("Acc1");
Thread t1 = new Thread(new DepoThread(accountObject, 10000));
Thread t2 = new Thread(new DrawThread(accountObject, 2000));
Thread t3 = new Thread(new BalThread(accountObject));

Account accountObject2 = new Account("Acc2");


Thread t12 = new Thread(new DepoThread(accountObject2, 50000));
Thread t22 = new Thread(new DrawThread(accountObject2, 3000));
Thread t32 = new Thread(new BalThread(accountObject2));
t12.start(); t22.start(); t32.start();
t1.start(); t2.start(); t3.start();
} }
class Account { // the 'monitor'
int balance;
String name;
public Account() {}
public Account(String n) {name=n;}
// if 'synchronized' is removed, the outcome is unpredictable
public void deposit(int deposit_amount) {
System.out.println("\nDeposit amount" + deposit_amount + " in " +
name);
balance += deposit_amount; }
public void withdraw(int deposit_amount) {
System.out.println("\nWithdrawn amount" + deposit_amount + " from " +
name );
balance -= deposit_amount; }
public void enquire() {
System.out.println("\nBalance=" + balance + " in "+ name); }
}

Akshay Singh (to Everyone): 10:24:

Deposit amount50000 in Acc2


Balance=0 in Acc1

Withdrawn amount2000 from Acc1

Deposit amount10000 in Acc1

Balance=0 in Acc2

Withdrawn amount3000 from Acc2


APURV AGNIHOTRI (to Everyone): 10:24:
Deposit amount50000 in Acc2

Balance=0 in Acc2

Withdrawn amount3000 from Acc2

Deposit amount10000 in Acc1

Withdrawn amount2000 from Acc1

Balance=8000 in Acc1
Deep Shikhar Singh (to Everyone): 10:24: Deposit amount10000 in Acc1

Withdrawn amount2000 from Acc1

Withdrawn amount3000 from Acc2

Balance=0 in Acc2

Deposit amount50000 in Acc2

Balance=8000 in Acc1

K Prasanna Kumar (to Everyone): 10:25:


Withdrawn amount2000 in acc1

Balance=0 in acc2

Withdrawn amount3000 in acc2


Deposit amount50000 in acc2

Balance=0 in acc1

Deposit amount10000 in acc1

shivendra gupta (to Everyone): 10:25: Deposit amount50000 in Acc2

Balance=0 in Acc2

Withdrawn amount3000 from Acc2

Deposit amount10000 in Acc1

Withdrawn amount2000 from Acc1

Balance=8000 in Acc1
Kushagra Gupta (to Everyone): 10:25: Deposit amount50000 in Acc2

Balance=0 in Acc2

Withdrawn amount3000 from Acc2

Deposit amount10000 in Acc1

Withdrawn amount2000 from Acc1

Balance=8000 in Acc1
Saumya Vishwakarma (to Everyone): 10:25: Deposit amount50000 in Acc2

Balance=0 in Acc2

Withdrawn amount3000 from Acc2

Deposit amount10000 in Acc1

Withdrawn amount2000 from Acc1

Balance=8000 in Acc1
Shipra Yadav (to Everyone): 10:26:

Deposit amount50000 in Acc2

Balance=0 in Acc1

Withdrawn amount2000 from Acc1

Deposit amount10000 in Acc1

Balance=0 in Acc2

Withdrawn amount3000 from Acc2


Atul Gupta (to Everyone): 10:26:
Withdrawn amount3000 from Acc2

Deposit amount10000 in Acc1

Withdrawn amount2000 from Acc1

Deposit amount50000 in Acc2

Balance=0 in Acc2

Balance=0 in Acc1
Akshay Singh (to Everyone): 10:26:
Deposit amount50000 in
Acc2

Balance=0 in
Acc1

Withdrawn amount2000 from


Acc1

Deposit amount10000 in

Balance=0 in
Acc2
Withdrawn amount3000 from
Acc1
Acc2
Naveen Kumar Mittal (to Everyone): 10:26:
Deposit amount50000 in Acc2

Withdrawn amount2000 from Acc1

Deposit amount10000 in Acc1

Balance=0 in Acc2

Withdrawn amount3000 from Acc2

Balance=8000 in Acc1

Piyush Shukla (to Everyone): 10:26: Deposit amount50000 in Acc2

Balance=0 in Acc2

Withdrawn amount3000 from Acc2

Deposit amount10000 in Acc1

Withdrawn amount2000 from Acc1

Balance=8000 in Acc1

Ravi Pratap (to Everyone): 10:26: Deposit amount10000 in Acc1

Deposit amount50000 in Acc2

Balance=0 in Acc2

Withdrawn amount3000 from Acc2

Withdrawn amount2000 from Acc1

Balance=0 in Acc1
AMAN SAXENA (to Everyone): 10:27:
Deposit amount50000 in Account 2

Deposit amount10000 in Account 1

Withdrawn amount35000 from Account 2

Withdrawn amount8000 from Account 1

Balance of Account 2    is = 15000

Balance of Account 1    is = 2000

Shikhar Shukla (to Everyone): 10:27:


Deposit amount50000 in Acc2

Deposit amount10000 in Acc1

Balance=0 in Acc2

Withdrawn amount2000 from Acc1

Withdrawn amount3000 from Acc2

Balance=8000 in Acc1

Harthik Ps (to Everyone): 10:28:


Withdrawn amount3000 from Acc2

Deposit amount50000 in Acc2

Balance=0 in Acc1

Deposit amount10000 in Acc1

Withdrawn amount2000 from Acc1

Balance=0 in Acc2
A
Unnati (to Everyone): 10:28:
Deposit amount50000 in Acc2

Balance=0 in Acc2

Deposit amount10000 in Acc1

Withdrawn amount3000 from Acc2

Withdrawn amount2000 from Acc1

Balance=8000 in Acc1

Monica (to Everyone): 10:28: public class InternetBankingSystem {


public static void main(String[] args) {
Account accountObject = new Account("Acc1");
Thread t1 = new Thread(new DepoThread(accountObject, 10000));
Thread t2 = new Thread(new DrawThread(accountObject, 2000));
Thread t3 = new Thread(new BalThread(accountObject));

Account accountObject2 = new Account("Acc2");


Thread t12 = new Thread(new DepoThread(accountObject2, 50000));
Thread t22 = new Thread(new DrawThread(accountObject2, 3000));
Thread t32 = new Thread(new BalThread(accountObject2));
t12.start(); t22.start(); t32.start();
t1.start(); t2.start(); t3.start();
} }
class Account { // the 'monitor'
int balance;
String name;
public Account() {}
public Account(String n) {name=n;}
// if 'synchronized' is removed, the outcome is unpredictable
public synchronized void deposit(int deposit_amount) {
System.out.print("\nDeposit amount" + deposit_amount + " in ");
System.out.println(name);
balance += deposit_amount; }
public synchronized void withdraw(int deposit_amount) {
System.out.print("\nWithdrawn amount" + deposit_amount + " from ");
System.out.println(name);
balance -= deposit_amount; }
public synchronized void enquire() {
System.out.print("\nBalance=" + balance + " in ");
System.out.println(name);}
}

Unnati (to Everyone): 10:29:


Withdrawn amount3000 from Acc2

Deposit amount10000 in Acc1

Deposit amount50000 in Acc2

Balance=10000 in Acc1

Balance=47000 in Acc2

Withdrawn amount2000 from Acc1

Naveen Kumar Mittal (to Everyone): 10:29:


Deposit amount50000 in Acc2

Deposit amount10000 in Acc1

Balance=50000 in Acc2

Withdrawn amount2000 from Acc1

Withdrawn amount3000 from Acc2

Balance=8000 in Acc1

Atul Gupta (to Everyone): 10:29:


Deposit amount10000 in
Deposit amount50000 in Acc2
Acc1

Balance=10000 in Acc1

Balance=50000 in Acc2
Withdrawn amount2000 from Acc1

Withdrawn amount3000 from Acc2


Akshay Singh (to Everyone): 10:30:
Deposit amount 50000 in Acc2

Deposit amount 10000 in Acc1

Balance= 50000 in Acc2

Withdrawn amount 2000 in Acc1

Withdrawn amount 3000 in Acc2

Balance= 8000 in Acc1


shivendra gupta (to Everyone): 10:30: Deposit amount50000 in Acc2

Deposit amount10000 in Acc1

Balance=50000 in Acc2

Withdrawn amount2000 from Acc1

Withdrawn amount3000 from Acc2

Balance=8000 in Acc1
APURV AGNIHOTRI (to Everyone): 10:30:
Deposit amount50000 in Acc2

Balance=50000 in Acc2

Withdrawn amount3000 from Acc2

Withdrawn amount2000 from Acc1

Deposit amount10000 in Acc1

Balance=8000 in Acc1
Saumya Vishwakarma (to Everyone): 10:30: Deposit amount10000 in
Deposit amount50000 in Acc2
Acc1

Balance=10000 in Acc1

Balance=50000 in Acc2

Withdrawn amount2000 from Acc1

Withdrawn amount3000 from Acc2


Deep Shikhar Singh (to Everyone): 10:31: Deposit amount10000 in
Deposit amount50000 in Acc2
Acc1

Balance=50000 in Acc2

Balance=10000 in Acc1

Withdrawn amount3000 from Acc2

Withdrawn amount2000 from Acc1

AMAN SAXENA (to Everyone): 10:31: Deposit amount50000 in Account 2

Deposit amount10000 in Account 1

Withdrawn amount35000 from Account 2

Withdrawn amount8000 from Account 1

Balance of Account 2    is = 15000

Balance of Account 1    is = 2000


Harthik Ps (to Everyone): 10:31:
Deposit amount50000 in Acc2

Deposit amount10000 in Acc1

Balance=50000 inAcc2

Withdrawn amount2000 from Acc1


Withdrawn amount3000 from Acc2

Balance=8000 inAcc1

Shikhar Shukla (to Everyone): 10:32:


Deposit amount50000 in Acc2
Deposit amount10000 in Acc1
Balance=50000 in Acc2

Withdrawn amount2000 from Acc1

Withdrawn amount3000 from Acc2

Balance=8000 in Acc1

Shipra Yadav (to Everyone): 10:32:


Deposit amount50000 in Acc2

Balance=50000 in Acc2

Withdrawn amount3000 from Acc2

Withdrawn amount2000 from Acc1

Deposit amount10000 in Acc1

Balance=8000 in Acc1
K Prasanna Kumar (to Everyone): 10:32:
Deposit amount50000 in
acc2

Balance=50000 in
acc2

Deposit amount10000 in
acc1

Withdrawn amount3000 from


acc2
Balance=10000 in
acc1

Withdrawn amount2000 from


acc1

APURV AGNIHOTRI (to Everyone): 10:33:


Deposit amount50000 in
Deposit amount10000 in Acc1
Acc2

Withdrawn amount2000 from Acc1

Balance=50000 in Acc2

Balance=8000 in
Withdrawn amount3000 from Acc2
Acc1

Chirag Yadav (to Everyone): 10:33: Deposit amount50000 in Acc2

Deposit amount10000 in Acc1

Balance=50000 inAcc2

Withdrawn amount2000 from Acc1

Withdrawn amount3000 from Acc2

Balance=8000 inAcc1Deposit amount50000 in Acc2

Balance=50000 in Acc2

Withdrawn amount3000 from Acc2

Withdrawn amount2000 from Acc1

Deposit amount10000 in Acc1


Balance=8000 in Acc1
Piyush Shukla (to Everyone): 10:35:
Deposit amount50000 in Acc2

Withdrawn amount3000 from Acc2

Withdrawn amount2000 from Acc1

Balance=-2000 in
Balance=47000 in Acc2
Acc1

Deposit amount10000 in Acc1

Naveen Kumar Mittal (to Everyone): 10:36:


Deposit amount10000 in Acc1

Deposit amount50000 in Acc2

Balance=10000 in Acc1

Balance=50000 in Acc2

Withdrawn amount2000 from Acc1

Withdrawn amount3000 from Acc2


Akshay Singh (to Everyone): 10:36:
Deposit amount 50000 in

Deposit amount 10000 in


Acc1

Balance= 10000 in
Acc2

Balance= 50000 in
Acc1

Withdrawn amount 2000 in


Acc2
Withdrawn amount 3000 in
Acc1
Acc2
Harthik Ps (to Everyone): 10:37:
Deposit amount10000 in Acc1

Deposit amount50000 in Acc2

Balance=10000 inAcc1

Balance=50000 inAcc2

Withdrawn amount2000 from Acc1

Withdrawn amount3000 from Acc2

Syed Ali Abbas (to Everyone): 10:37:


Deposit amount50000 in Acc2

Deposit amount10000 in
Balance=50000 in Acc2
Acc1

Withdrawn amount3000 from Acc2

Balance=10000 in Acc1

Withdrawn amount2000 from Acc1


K Prasanna Kumar (to Everyone): 10:39:
Deposit amount10000 in

Deposit amount50000 in
acc2
acc1

Balance=50000 in

Withdrawn amount2000 from


acc2
Withdrawn amount3000 from
acc1

Balance=8000 in
acc1
acc2

Monica (to Everyone): 10:40: package Batch1;

class DepoThread implements Runnable {


Account account; int amt;
public DepoThread(Account s, int a) {
account = s; amt = a; }
public void run() {
account.deposit(amt); }
}
class DrawThread implements Runnable {
Account account;    int amt;
public DrawThread(Account s, int a) {
account = s; amt = a; }
public void run() {
account.withdraw(amt); }
}
class BalThread implements Runnable {
Account account;
public BalThread(Account s) {
account = s;    }
public void run() {
account.enquire(); }
}
public class InternetBankingSystem {
public static void main(String[] args) {
Account accountObject = new Account("Acc1");
Thread t1 = new Thread(new DepoThread(accountObject, 10000));
Thread t2 = new Thread(new DrawThread(accountObject, 2000));
Thread t3 = new Thread(new BalThread(accountObject));

Account accountObject2 = new Account("Acc2");


Thread t12 = new Thread(new DepoThread(accountObject2, 50000));
Thread t22 = new Thread(new DrawThread(accountObject2, 3000));
Thread t32 = new Thread(new BalThread(accountObject2));
t12.start(); t22.start(); t32.start();
t1.start(); t2.start(); t3.start();
} }
class Account { // the 'monitor'
int balance;
String name;
public Account() {}
public Account(String n) {name=n;}
// if 'synchronized' is removed, the outcome is unpredictable
public synchronized void deposit(int deposit_amount) {

System.out.print("\nDeposit amount" + deposit_amount + " in ");


try{Thread.sleep(1000);}catch(Exception e) {}
System.out.println(name);
balance += deposit_amount; }
public synchronized void withdraw(int deposit_amount) {

System.out.print("\nWithdrawn amount" + deposit_amount + " from ");


try{Thread.sleep(500);}catch(Exception e) {}
System.out.println(name);
balance -= deposit_amount; }
public synchronized void enquire() {

System.out.print("\nBalance=" + balance + " in ");


try{Thread.sleep(600);}catch(Exception e) {}
System.out.println(name);
}
}

APURV AGNIHOTRI (to Everyone): 10:42:


Deposit amount50000 in
Deposit amount10000 in Acc2

Balance=50000 in Acc1

Balance=10000 in Acc2

Withdrawn amount3000 from Acc1


Withdrawn amount2000 from Acc2
Acc1

Akshay Singh (to Everyone): 10:42:


Deposit amount 50000 in

Deposit amount 10000 in


Acc1

Balance= 10000 in
Acc2

Balance= 50000 in
Acc2

Withdrawn amount 3000 in


Acc1

Withdrawn amount 2000 in


Acc2
Acc1

shivendra gupta (to Everyone): 10:42: Deposit amount50000 in


Deposit amount10000 in Acc2

Balance=50000 in Acc1

Balance=10000 in Acc2

Withdrawn amount3000 from Acc1

Withdrawn amount2000 from Acc2


Acc1
K Prasanna Kumar (to Everyone): 10:42:
Deposit amount10000 in
Deposit amount50000 in acc2
acc1

Withdrawn amount3000 from


Balance=10000 in acc2

Balance=47000 in acc1

Withdrawn amount2000 from acc1


acc2

Shivaksh Ahalawat (to Everyone): 10:42:


Deposit amount50000 in
Deposit amount10000 in Acc2
Acc1

Balance=50000 in
Balance=10000 in Acc2

Withdrawn amount3000 from Acc1

Withdrawn amount2000 from Acc2


Acc1

Ravi Pratap (to Everyone): 10:43: Deposit amount50000 in


Deposit amount10000 in Acc2
Acc1

Balance=50000 in
Balance=10000 in Acc2

Withdrawn amount3000 from Acc1

Withdrawn amount2000 from Acc2


Acc1
Shipra Yadav (to Everyone): 10:43:
Deposit amount50000 in
Deposit amount10000 in Acc2
Acc1

Balance=50000 in
Balance=10000 in Acc2

Withdrawn amount3000 from Acc1


Withdrawn amount2000 from Acc2
Acc1

AMAN SAXENA (to Everyone): 10:44:


Deposit amount50000 in Acc2

Deposit amount10000 in Acc1

Withdrawn amount3000 from Acc2

Balance of Acc1    is = 10000

Balance of Acc2    is = 47000

Withdrawn amount2000 from Acc1

Piyush Shukla (to Everyone): 10:44:


Withdrawn amount3000 from
Withdrawn amount2000 from Acc2

Balance=-3000 in Acc1

Deposit amount10000 in Acc2

Deposit amount50000 in Acc1

Balance=8000 in Acc2
Acc1

Withdrawn amount3000 from


Deposit amount10000 in Acc2

Deposit amount50000 in Acc1

Balance=10000 in Acc2

Balance=47000 in Acc1

Withdrawn amount2000 from Acc1


Acc2

Abhishek Kaushik (to Everyone): 10:45:


Deposit amount50000 in
Deposit amount10000 in Acc1
Acc2

Balance=10000 in
Balance=50000 in Acc2
Acc1

Withdrawn amount3000 from


Withdrawn amount2000 from Acc2
Acc1

Monica (to Everyone): 10:45: package Batch1;

class DepoThread implements Runnable {


Account account; int amt;
public DepoThread(Account s, int a) {
account = s; amt = a; }
public void run() {
account.deposit(amt); }
}
class DrawThread implements Runnable {
Account account;    int amt;
public DrawThread(Account s, int a) {
account = s; amt = a; }
public void run() {
account.withdraw(amt); }
}
class BalThread implements Runnable {
Account account;
public BalThread(Account s) {
account = s;    }
public void run() {
account.enquire(); }
}
public class InternetBankingSystem {
public static void main(String[] args) {
Account accountObject = new Account("Acc1");
Thread t1 = new Thread(new DepoThread(accountObject, 10000));
Thread t2 = new Thread(new DrawThread(accountObject, 2000));
Thread t3 = new Thread(new BalThread(accountObject));

Account accountObject2 = new Account("Acc2");


Thread t12 = new Thread(new DepoThread(accountObject2, 50000));
Thread t22 = new Thread(new DrawThread(accountObject2, 3000));
Thread t32 = new Thread(new BalThread(accountObject2));
t12.start(); t22.start(); t32.start();
t1.start(); t2.start(); t3.start();
} }
class Account { // the 'monitor'
int balance;
String name;
public Account() {}
public Account(String n) {name=n;}
// if 'synchronized' is removed, the outcome is unpredictable
public synchronized void deposit(int deposit_amount) {
try{Thread.sleep(1000);}catch(Exception e) {}
System.out.print("\nDeposit amount" + deposit_amount + " in "+ name);
balance += deposit_amount; }
public synchronized void withdraw(int deposit_amount) {
try{Thread.sleep(500);}catch(Exception e) {}
System.out.print("\nWithdrawn amount" + deposit_amount + " from "+
name);
balance -= deposit_amount; }
public synchronized void enquire() {
try{Thread.sleep(600);}catch(Exception e) {}
System.out.print("\nBalance=" + balance + " in " + name);
}
}

APURV AGNIHOTRI (to Everyone): 10:46:


Deposit amount50000 in Acc2
Deposit amount10000 in Acc1
Balance=50000 in Acc2
Balance=10000 in Acc1
Withdrawn amount3000 from Acc2
Withdrawn amount2000 from Acc1
Piyush Shukla (to Everyone): 10:46:
Deposit amount50000 in Acc2
Deposit amount10000 in Acc1
Balance=10000 in Acc1
Balance=50000 in Acc2
Withdrawn amount2000 from Acc1
Withdrawn amount3000 from Acc2
Deep Shikhar Singh (to Everyone): 10:46: Deposit amount50000 in Acc2
Deposit amount10000 in Acc1
Balance=50000 in Acc2
Balance=10000 in Acc1
Withdrawn amount3000 from Acc2
Withdrawn amount2000 from Acc1
Syed Ali Abbas (to Everyone): 10:46: Deposit amount10000 in Acc1
Deposit amount50000 in Acc2
Balance=50000 in Acc2
Balance=10000 in Acc1
Withdrawn amount2000 from Acc1
Withdrawn amount3000 from Acc2
Shipra Yadav (to Everyone): 10:46: Deposit amount50000 in Acc2
Deposit amount10000 in Acc1
Balance=50000 in Acc2
Balance=10000 in Acc1
Withdrawn amount3000 from Acc2
Withdrawn amount2000 from Acc1
Atul Gupta (to Everyone): 10:46:
Deposit amount10000 in Acc1
Deposit amount50000 in Acc2
Balance=50000 in Acc2
Balance=10000 in Acc1
Withdrawn amount2000 from Acc1
Withdrawn amount3000 from Acc2
AMAN SAXENA (to Everyone): 10:46: Deposit amount50000 in Acc2
Deposit amount10000 in Acc1
Balance=50000 in Acc2
Balance=10000 in Acc1
Withdrawn amount3000 from Acc2
Withdrawn amount2000 from Acc1

Ravi Pratap (to Everyone): 10:47: Deposit amount50000 in Acc2


Deposit amount10000 in Acc1
Balance=10000 in Acc1
Balance=50000 in Acc2
Withdrawn amount2000 from Acc1
Withdrawn amount3000 from Acc2
Shikhar Shukla (to Everyone): 10:47: Deposit amount50000 in Acc2
Deposit amount10000 in Acc1
Withdrawn amount2000 from Acc1
Balance=50000 in Acc2
Withdrawn amount3000 from Acc2
Balance=8000 in Acc1
Piyush Shukla (to Everyone): 10:48:
Withdrawn amount3000 from Acc2
Withdrawn amount2000 from Acc1
Balance=-3000 in Acc2
Balance=-2000 in Acc1
Deposit amount50000 in Acc2
Deposit amount10000 in Acc1
K Prasanna Kumar (to Everyone): 10:48: Deposit amount10000 in Acc1
Deposit amount50000 in Acc2
Withdrawn amount3000 from Acc2
Withdrawn amount2000 from Acc1
Balance=47000 in Acc2
Balance=8000 in Acc1
MAYANK KUMAR (to Everyone): 10:48:
Deposit amount10000 in Acc1
Deposit amount50000 in Acc2
Withdrawn amount2000 from Acc1
Balance=50000 in Acc2
Balance=8000 in Acc1
Withdrawn amount3000 from Acc2
Harthik Ps (to Everyone): 10:48:
Withdrawn amount3000 from Acc2

Withdrawn amount2000 from Acc1

Balance=-3000 inAcc2

Balance=-2000 inAcc1
Deposit amount10000 in Acc1

Deposit amount50000 in Acc2

Monica (to Everyone): 10:48: Tea break 15 min


Akshay Singh (to Everyone): 10:49:
Deposit amount 50000 in

Withdrawn amount 2000 in


Acc1

Balance= -2000 in
Acc1

Deposit amount 10000 in


Acc1
Acc2

Balance= 50000 in
Acc2

Withdrawn amount 3000 in


Acc2
Akshay Singh (to Everyone): 11:06: Back
shivendra gupta (to Everyone): 11:06: back
Saumya Vishwakarma (to Everyone): 11:06: Back
Kushagra Gupta (to Everyone): 11:06: back
Atul Gupta (to Everyone): 11:06: back
Deep Shikhar Singh (to Everyone): 11:06: back
APURV AGNIHOTRI (to Everyone): 11:06: back
Shipra Yadav (to Everyone): 11:06: Back
Shivaksh Ahalawat (to Everyone): 11:06: back
Abhishek Kaushik (to Everyone): 11:06: back
Naveen Kumar Mittal (to Everyone): 11:06: back
Ravi Pratap (to Everyone): 11:06: back
Piyush Shukla (to Everyone): 11:06: Back
K Prasanna Kumar (to Everyone): 11:06: Back
Harthik Ps (to Everyone): 11:07: back
Shikhar Shukla (to Everyone): 11:07: back
Syed Ali Abbas (to Everyone): 11:08: back
Monica (to Everyone): 11:11: class A extends Thread {
String s;
public A(String str) {s=str;}
public void run() {
System.out.println("Thread: " + s + " started");
for (int i = 1; i <= 4; i++) {
System.out.println("\t From "+ s+" : i= " + i); }
System.out.println("Exit from " + s); }
}
public class ThreadPriority {
public static void main(String args[]) {
A threadA = new A("ThreadA");
A threadB = new A("ThreadB");
A threadC = new A("ThreadC");
threadC.setPriority(Thread.MAX_PRIORITY);
threadB.setPriority(threadA.getPriority() + 1);
threadA.setPriority(Thread.MIN_PRIORITY);
System.out.println("Started Thread A");
threadA.start();
System.out.println("Started Thread B");
threadB.start();
System.out.println("Started Thread C");
threadC.start();
System.out.println("End of main thread");
}
}

Saumya Vishwakarma (to Everyone): 11:13: Started Thread A


Started Thread B
Started Thread C
End of main thread
Thread: ThreadA started
From ThreadA : i= 1
Thread: ThreadB started
From ThreadA : i= 2
Thread: ThreadC started
From ThreadC : i= 1
From ThreadC : i= 2
From ThreadB : i= 1
From ThreadC : i= 3
From ThreadC : i= 4
From ThreadA : i= 3
Exit from ThreadC
From ThreadB : i= 2
From ThreadB : i= 3
From ThreadB : i= 4
From ThreadA : i= 4
Exit from ThreadB
Exit from ThreadA

Piyush Shukla (to Everyone): 11:13: Started Thread A


Started Thread B
Started Thread C
End of main thread
Thread: ThreadC started
From ThreadC : i= 1
From ThreadC : i= 2
From ThreadC : i= 3
From ThreadC : i= 4
Exit from ThreadC
Thread: ThreadB started
From ThreadB : i= 1
From ThreadB : i= 2
From ThreadB : i= 3
From ThreadB : i= 4
Exit from ThreadB
Thread: ThreadA started
From ThreadA : i= 1
From ThreadA : i= 2
From ThreadA : i= 3
From ThreadA : i= 4
Exit from ThreadA

AMAN SAXENA (to Everyone): 11:13: Started Thread A


Started Thread B
Started Thread C
End of main thread
Thread: ThreadB started
From ThreadB : i= 1
From ThreadB : i= 2
From ThreadB : i= 3
Thread: ThreadC started
From ThreadC : i= 1
From ThreadC : i= 2
From ThreadB : i= 4
Exit from ThreadB
From ThreadC : i= 3
From ThreadC : i= 4
Exit from ThreadC
Thread: ThreadA started
From ThreadA : i= 1
From ThreadA : i= 2
From ThreadA : i= 3
From ThreadA : i= 4
Exit from ThreadA

Atul Gupta (to Everyone): 11:13: Started Thread A


Started Thread B
Started Thread C
End of main thread
Thread: ThreadC started
From ThreadC : i= 1
Thread: ThreadA started
From ThreadC : i= 2
Thread: ThreadB started
From ThreadC : i= 3
From ThreadA : i= 1
From ThreadC : i= 4
From ThreadB : i= 1
Exit from ThreadC
From ThreadA : i= 2
From ThreadB : i= 2
From ThreadA : i= 3
From ThreadB : i= 3
From ThreadA : i= 4
From ThreadB : i= 4
Exit from ThreadA
Exit from ThreadB
Abhishek Kaushik (to Everyone): 11:13: Started Thread A
Started Thread B
Started Thread C
End of main thread
Thread: ThreadA started
From ThreadA : i= 1
From ThreadA : i= 2
From ThreadA : i= 3
Thread: ThreadB started
From ThreadA : i= 4
Thread: ThreadC started
Exit from ThreadA
From ThreadB : i= 1
From ThreadC : i= 1
From ThreadB : i= 2
From ThreadC : i= 2
From ThreadB : i= 3
From ThreadC : i= 3
From ThreadB : i= 4
From ThreadC : i= 4
Exit from ThreadB
Exit from ThreadC

APURV AGNIHOTRI (to Everyone): 11:13: Started Thread A


Started Thread B
Started Thread C
Thread: ThreadA started
Thread: ThreadB started
End of main thread
From ThreadA : i= 1
From ThreadB : i= 1
From ThreadB : i= 2
From ThreadA : i= 2
From ThreadB : i= 3
Thread: ThreadC started
From ThreadB : i= 4
From ThreadA : i= 3
Exit from ThreadB
From ThreadC : i= 1
From ThreadA : i= 4
Exit from ThreadA
From ThreadC : i= 2
From ThreadC : i= 3
From ThreadC : i= 4
Exit from ThreadC
Shikhar Shukla (to Everyone): 11:13: Started Thread A
Started Thread B
Started Thread C
Thread: ThreadA started
Thread: ThreadB started
End of main thread
From ThreadA : i= 1
From ThreadB : i= 1
From ThreadB : i= 2
From ThreadA : i= 2
Thread: ThreadC started
From ThreadB : i= 3
From ThreadC : i= 1
From ThreadC : i= 2
From ThreadA : i= 3
From ThreadC : i= 3
From ThreadB : i= 4
From ThreadC : i= 4
From ThreadA : i= 4
Exit from ThreadC
Exit from ThreadB
Exit from ThreadA

Akshay Singh (to Everyone): 11:14: Started Thread A


Started Thread B
Started Thread C
Thread: ThreadB started
Thread: ThreadC started
End of main thread
From ThreadB : i= 1
From ThreadC : i= 1
From ThreadC : i= 2
From ThreadC : i= 3
From ThreadC : i= 4
Exit from ThreadC
From ThreadB : i= 2
From ThreadB : i= 3
From ThreadB : i= 4
Exit from ThreadB
Thread: ThreadA started
From ThreadA : i= 1
From ThreadA : i= 2
From ThreadA : i= 3
From ThreadA : i= 4
Exit from ThreadA

MAYANK KUMAR (to Everyone): 11:14: Started Thread A


Started Thread B
Started Thread C
End of main thread
Thread: ThreadA started
From ThreadA : i= 1
Thread: ThreadB started
From ThreadB : i= 1
From ThreadB : i= 2
From ThreadA : i= 2
Thread: ThreadC started
From ThreadA : i= 3
From ThreadB : i= 3
From ThreadA : i= 4
From ThreadC : i= 1
From ThreadC : i= 2
From ThreadC : i= 3
From ThreadB : i= 4
From ThreadC : i= 4
Exit from ThreadA
Exit from ThreadC
Exit from ThreadB

Unnati (to Everyone): 11:14: Started Thread A


Started Thread B
Started Thread C
End of main thread
Thread: ThreadC started
From ThreadC : i= 1
From ThreadC : i= 2
From ThreadC : i= 3
From ThreadC : i= 4
Exit from ThreadC
Thread: ThreadB started
From ThreadB : i= 1
From ThreadB : i= 2
From ThreadB : i= 3
From ThreadB : i= 4
Exit from ThreadB
Thread: ThreadA started
From ThreadA : i= 1
From ThreadA : i= 2
From ThreadA : i= 3
From ThreadA : i= 4
Exit from ThreadA

Ravi Pratap (to Everyone): 11:14: Started Thread A


Started Thread B
Started Thread C
End of main thread
Thread: ThreadB started
Thread: ThreadA started
Thread: ThreadC started
From ThreadC : i= 1
From ThreadB : i= 1
From ThreadA : i= 1
From ThreadC : i= 2
From ThreadC : i= 3
From ThreadC : i= 4
From ThreadA : i= 2
From ThreadB : i= 2
From ThreadA : i= 3
Exit from ThreadC
From ThreadA : i= 4
Exit from ThreadA
From ThreadB : i= 3
From ThreadB : i= 4
Exit from ThreadB

shivendra gupta (to Everyone): 11:14: Started Thread A


Started Thread B
Started Thread C
End of main thread
Thread: ThreadA started
    From ThreadA : i= 1
    From ThreadA : i= 2
    From ThreadA : i= 3
Thread: ThreadB started
    From ThreadA : i= 4
Thread: ThreadC started
Exit from ThreadA
    From ThreadB : i= 1
    From ThreadC : i= 1
    From ThreadB : i= 2
    From ThreadC : i= 2
    From ThreadB : i= 3
    From ThreadC : i= 3
    From ThreadB : i= 4
    From ThreadC : i= 4
Exit from ThreadB
Exit from ThreadC
Harthik Ps (to Everyone): 11:14: Started Thread A
Started Thread B
Started Thread C
Thread: ThreadA started
End of main thread
From ThreadA : i= 1
From ThreadA : i= 2
Thread: ThreadB started
Thread: ThreadC started
From ThreadC : i= 1
From ThreadA : i= 3
From ThreadA : i= 4
From ThreadC : i= 2
From ThreadB : i= 1
From ThreadC : i= 3
Exit from ThreadA
From ThreadC : i= 4
From ThreadB : i= 2
Exit from ThreadC
From ThreadB : i= 3
From ThreadB : i= 4
Exit from ThreadB

K Prasanna Kumar (to Everyone): 11:15: Started Thread A


Started Thread B
Started Thread C
Thread: ThreadA started
From ThreadA : i= 1
End of main thread
From ThreadA : i= 2
Thread: ThreadB started
From ThreadA : i= 3
Thread: ThreadC started
From ThreadA : i= 4
Exit from ThreadA
From ThreadB : i= 1
From ThreadC : i= 1
From ThreadB : i= 2
From ThreadC : i= 2
From ThreadB : i= 3
From ThreadC : i= 3
From ThreadB : i= 4
From ThreadC : i= 4
Exit from ThreadB
Exit from ThreadC

Deep Shikhar Singh (to Everyone): 11:16: Started Thread A


Started Thread B
Started Thread C
Thread: ThreadA started
End of main thread
From ThreadA : i= 1
Thread: ThreadB started
From ThreadA : i= 2
Thread: ThreadC started
From ThreadA : i= 3
From ThreadB : i= 1
From ThreadC : i= 1
From ThreadB : i= 2
From ThreadB : i= 3
From ThreadB : i= 4
From ThreadA : i= 4
From ThreadC : i= 2
From ThreadC : i= 3
From ThreadC : i= 4
Exit from ThreadA
Exit from ThreadB
Exit from ThreadC
Kushagra Gupta (to Everyone): 11:16: Started Thread A
Started Thread B
Started Thread C
End of main thread
Thread: ThreadA started
    From ThreadA : i= 1
Thread: ThreadB started
    From ThreadB : i= 1
    From ThreadB : i= 2
    From ThreadA : i= 2
Thread: ThreadC started
    From ThreadA : i= 3
    From ThreadB : i= 3
    From ThreadA : i= 4
    From ThreadC : i= 1
    From ThreadC : i= 2
    From ThreadC : i= 3
    From ThreadB : i= 4
    From ThreadC : i= 4
Exit from ThreadA
Exit from ThreadC
Exit from ThreadB
APURV AGNIHOTRI (to Everyone): 11:16: Started Thread A
Started Thread B
Started Thread C
Thread: ThreadA started
Thread: ThreadB started
End of main thread
From ThreadA : i= 1
From ThreadB : i= 1
From ThreadB : i= 2
From ThreadA : i= 2
From ThreadB : i= 3
Thread: ThreadC started
From ThreadB : i= 4
From ThreadA : i= 3
Exit from ThreadB
From ThreadC : i= 1
From ThreadA : i= 4
Exit from ThreadA
From ThreadC : i= 2
From ThreadC : i= 3
From ThreadC : i= 4
Exit from ThreadC
Naveen Kumar Mittal (to Everyone): 11:16: Started Thread A
Started Thread B
Started Thread C
End of main thread
Thread: ThreadC started
From ThreadC : i= 1
From ThreadC : i= 2
From ThreadC : i= 3
From ThreadC : i= 4
Exit from ThreadC
Thread: ThreadB started
From ThreadB : i= 1
From ThreadB : i= 2
From ThreadB : i= 3
From ThreadB : i= 4
Exit from ThreadB
Thread: ThreadA started
From ThreadA : i= 1
From ThreadA : i= 2
From ThreadA : i= 3
From ThreadA : i= 4
Exit from ThreadA
Chirag Yadav (to Everyone): 11:16: Started Thread A
Started Thread B
Started Thread C
End of main thread
Thread: ThreadC started
    From ThreadC : i= 1
    From ThreadC : i= 2
    From ThreadC : i= 3
    From ThreadC : i= 4
Exit from ThreadC
Thread: ThreadB started
    From ThreadB : i= 1
    From ThreadB : i= 2
    From ThreadB : i= 3
    From ThreadB : i= 4
Exit from ThreadB
Thread: ThreadA started
    From ThreadA : i= 1
    From ThreadA : i= 2
    From ThreadA : i= 3
    From ThreadA : i= 4
Exit from ThreadA

Syed Ali Abbas (to Everyone): 11:17: Started Thread A


Started Thread B
Thread: ThreadA started
From ThreadA : i= 1
From ThreadA : i= 2
From ThreadA : i= 3
From ThreadA : i= 4
Thread: ThreadB started
Started Thread C
From ThreadB : i= 1
Exit from ThreadA
From ThreadB : i= 2
From ThreadB : i= 3
From ThreadB : i= 4
Exit from ThreadB
End of main thread
Thread: ThreadC started
From ThreadC : i= 1
From ThreadC : i= 2
From ThreadC : i= 3
From ThreadC : i= 4
Exit from ThreadC
Shivaksh Ahalawat (to Everyone): 11:20: Started Thread A
Started Thread B
Started Thread C
End of main thread
Thread: ThreadB started
Thread: ThreadA started
Thread: ThreadC started
From ThreadC : i= 1
From ThreadC : i= 2
From ThreadC : i= 3
From ThreadC : i= 4
Exit from ThreadC
From ThreadA : i= 1
From ThreadB : i= 1
From ThreadB : i= 2
From ThreadB : i= 3
From ThreadB : i= 4
Exit from ThreadB
From ThreadA : i= 2
From ThreadA : i= 3
From ThreadA : i= 4
Exit from ThreadA
Deep Shikhar Singh (to Everyone): 11:38: yes ma'am
Saumya Vishwakarma (to Everyone): 11:39: Ma'am clear
Monica (to Everyone): 11:52: class T1 implements Runnable {
Chat m;
String[] s1 = { "Hi", "How are you ?", "I am also doing fine!" };
public T1(Chat m1) {
this.m = m1; new Thread(this).start();
} public void run() { for (int i = 0; i < s1.length; i++) { m.Question("Person1: " + s1[i]);
}    } }
class T2 implements Runnable {
Chat m;
String[] s2 = { "Hi", "I am good, what about you?", "Great!" };
public T2(Chat m2) {
this.m = m2; new Thread(this).start();
} public void run() { for (int i = 0; i < s2.length; i++) {m.Answer("Person2: "    +
s2[i]); }    }    }
public class TestThread {
public static void main(String[] args) {
Chat m = new Chat();
new T1(m); new T2(m); } }

Monica (to Everyone): 11:52: package Batch1;

class Chat {
boolean flag = false;

public synchronized void Question(String msg) {


if (flag) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println(msg);
flag = true;
notify();
}

public synchronized void Answer(String msg) {


if (!flag) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println(msg);
flag = false;
notify();
}
}

class T1 implements Runnable {


Chat m;
String[] s1 = { "Hi", "How are you ?", "I am also doing fine!" };

public T1(Chat m1) {


this.m = m1;
new Thread(this).start();
}

public void run() {


for (int i = 0; i < s1.length; i++) {
m.Question("Person1: " + s1[i]);
}
}
}

class T2 implements Runnable {


Chat m;
String[] s2 = { "Hi", "I am good, what about you?", "Great!" };

public T2(Chat m2) {


this.m = m2;
new Thread(this).start();
}

public void run() {


for (int i = 0; i < s2.length; i++) {
m.Answer("Person2: " + s2[i]);
}
}
}

public class TestThread {


public static void main(String[] args) {
Chat m = new Chat();
new T1(m);
new T2(m);
}
}

Akshay Singh (to Everyone): 11:53: Person1: Hi


Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!
Atul Gupta (to Everyone): 11:53: Person1: Hi
Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!

Naveen Kumar Mittal (to Everyone): 11:53: Person1: Hi


Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!

Unnati (to Everyone): 11:53: Person1: Hi


Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!

Piyush Shukla (to Everyone): 11:53: Person1: Hi


Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!

Mohit Rai (to Everyone): 11:54: Person1: Hi


Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!
Abhishek Kaushik (to Everyone): 11:54: Person1: Hi
Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!

shivendra gupta (to Everyone): 11:54: Person1: Hi


Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!

Saumya Vishwakarma (to Everyone): 11:54: Person1: Hi


Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!

Harthik Ps (to Everyone): 11:54: Person1: Hi


Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!

Shivaksh Ahalawat (to Everyone): 11:54: Person1: Hi


Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!
AMAN SAXENA (to Everyone): 11:55: Person1: Hi
Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!

Shipra Yadav (to Everyone): 11:55: Person1: Hi


Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!

Nagareddy Deepthi (to Everyone): 11:56: Person1: Hi


Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!
Monica (to Everyone): 11:56: Prepare the same chat Application using real scenario
with proper inputs between user1 and user2 one by one.
We will exit if we enter 5 chats each

Saloni Dhawan (to Everyone): 11:59: Person1: Hi


Person2: Hi
Person1: How are you ?
Person2: I am good, what about you?
Person1: I am also doing fine!
Person2: Great!
Unnati (to Everyone): 12:24: Thanku mam
Monica (to Everyone): 12:35: package Batch1;

import java.util.Scanner;

class Chat {
boolean flag = false;
Scanner scanner = new Scanner(System.in);

public synchronized void Question() {


if (flag) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.print("Person1: ");
String msg= scanner.nextLine();
System.out.println(msg);
flag = true;
notify();
}

public synchronized void Answer() {


if (!flag) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.print("Person2: ");
String msg= scanner.nextLine();
System.out.println(msg);
flag = false;
notify();
}
}

class T1 implements Runnable {


Chat m;

public T1(Chat m1) {


this.m = m1;
new Thread(this).start();
}

public void run() {


for (int i = 0; i < 5; i++) {
m.Question();
}
}
}

class T2 implements Runnable {


Chat m;

public T2(Chat m2) {


this.m = m2;
new Thread(this).start();
}

public void run() {


for (int i = 0; i < 5; i++) {
m.Answer();
}
}
}

public class TestThread {


public static void main(String[] args) {
Chat m = new Chat();
new T1(m);
new T2(m);
}
}

Deep Shikhar Singh (to Everyone): 12:38: Person1: hello deep


hello deep
Person2: you are
you are
Person1: fine or not
fine or not
Person2: if not then why
if not then why
Person1: and if
and if
Person2: then also why
then also why
Person1: and if you dont answer
and if you dont answer
Person2: no problem
no problem
Person1: but still
but still
Person2: you should
you should

Atul Gupta (to Everyone): 12:39: Speaker1: how


how
Speaker2: good
good
Speaker1: whats
whats
Speaker2: is
is
Speaker1: going
going
Speaker2: done
done
Speaker1: ok
ok
Speaker2: thanks
thanks
Speaker1: where
where
Speaker2: name
name

APURV AGNIHOTRI (to Everyone): 12:39: Person1: hi


hi
Person2: hlo
hlo
Person1: how
how
Person2: when
when
Person1: why
why
Person2: don't no
don't no
Person1: ok
ok
Person2: by
by
Person1: byy
byy
Person2: why not
why no
Shikhar Shukla (to Everyone): 12:39: Person1: Hii
Hii
Person2: Hello
Hello
Person1: How are you?
How are you?
Person2: I am fine!
I am fine!
Person1: Have you studied java?
Have you studied java?
Person2: No, but I am catching up.
No, but I am catching up.
Person1: Great to know that...
Great to know that...
Person2: Have you studied Python?
Have you studied Python?
Person1: No.
No.
Person2: You should!
You should!
Shivaksh Ahalawat (to Everyone): 12:40: Person1: hii
hii
Person2: hii
hii
Person1: hello
hello
Person2: hello
hello
Person1: what are you doing studing?
what are you doing studing?
Person2: studying
studying
Person1: ok
ok
Person2: ok
ok
Person1: end
end
Person2: end
end
Saumya Vishwakarma (to Everyone): 12:40: Person1: Hii
Hii
Person2: Hello
Hello
Person1: How are you?
How are you?
Person2: I'm fine
I'm fine
Person1: How about your studies
How about your studies
Person2: It is going good
It is going good
Person1: Do you know Java
Do you know Java
Person2: Yes
Yes
Person1: It good
It good
Person2: Yaa
Yaa

Shipra Yadav (to Everyone): 12:42: Person1: hello


hello
Person2: Hii
Hii
Person1: how are you
how are you
Person2: I'm fine
I'm fine
Person1: ok
Ok
Person2: ok
Ok
Person1: Yaa
Yaa
Person2: Yes
Yes
Person1: end
end
Person2: end
end

Abhishek Kaushik (to Everyone): 12:42: Person1: hi


hi
Person2: hello
hello
Person1: where are u from
where are u from
Person2: I am from Grater Noida
I am from Grater Noida
Person1: And what about you
And what about you
Person2: I am from Delhi
I am from Delhi
Person1: That's Great
That's Great
Person2: yup
yup
Person1: bye
bye
Person2: ok bye
ok bye
Unnati (to Everyone): 12:42: Person1: hyy
hyy
Person2: hyy
hyy
Person1: how r u?
how r u?
Person2: I am fine and u?
I am fine and u?
Person1: I am also gud
I am also gud
Person2: how's ur day?
how's ur day?
Person1: it's gud
it's gud
Person2: great
great
Person1: nice
nice
Person2: okk
okk

Naveen Kumar Mittal (to Everyone): 12:42: Person1: hi


hi
Person2: hi
hi
Person1: how are you
how are you
Person2: i am fine
i am fine
Person1: what about you
what about you
Person2: i am also fine
i am also fine
Person1: what do you know about java
what do you know about java
Person2: java is a best language
java is a best language
Person1: yeah i think you are right
yeah i think you are right
Person2: thank you
thank you

Monica (to Everyone): 12:45: public class ThreadPrg1 implements Runnable {


Thread t;
public void run() {
for (int i = 0; i < 4; i++) {
System.out.println(Thread.currentThread().getName() + " " + i);
try {
Thread.sleep(1000); // thread to sleep for 1000 milliseconds
}    catch (Exception e) {
System.out.println(e);
} } }
public static void main(String[] args) throws Exception {
Thread t = new Thread(new ThreadPrg1());
t.start();
Thread t2 = new Thread(new ThreadPrg1());
t2.start();
} }
Saloni Dhawan (to Everyone): 12:45: Person1: hello
hello
Person2: hi
hi
Person1: how are you?
how are you?
Person2: I am good
I am good
Person1: What are you doing?
What are you doing?
Person2: Nothing
Nothing
Person1: What about your studies?
What about your studies?
Person2: good good         
good good
Person1: Okay
Okay
Person2: Yup
Yup
Unnati (to Everyone): 12:46: Thread-0 0
Thread-1 0
Thread-1 1
Thread-0 1
Thread-1 2
Thread-0 2
Thread-1 3
Thread-0 3

Piyush Shukla (to Everyone): 12:46: Thread-0 0


Thread-1 0
Thread-0 1
Thread-1 1
Thread-1 2
Thread-0 2
Thread-1 3
Thread-0 3

Deep Shikhar Singh (to Everyone): 12:46: Thread-0 0


Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3
Saumya Vishwakarma (to Everyone): 12:46: Thread-0 0
Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3

APURV AGNIHOTRI (to Everyone): 12:47: Thread-0 0


Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3

Abhishek Rana (to Everyone): 12:47: Thread-0 0


Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-1 3
Thread-0 3

Naveen Kumar Mittal (to Everyone): 12:47: Thread-2 0


Thread-3 0
Thread-3 1
Thread-2 1
Thread-3 2
Thread-2 2
Thread-2 3
Thread-3 3
Shipra Yadav (to Everyone): 12:47: Thread-0 0
Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3

Kushagra Gupta (to Everyone): 12:47: Thread-0 0


Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3
Saloni Dhawan (to Everyone): 12:47: Thread-0 0
Thread-1 0
Thread-1 1
Thread-0 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3
Monica (to Everyone): 12:47: public class ThreadPrg1 implements Runnable {
Thread t;
public void run() {
for (int i = 0; i < 4; i++) {
System.out.println(Thread.currentThread().getName() + " " + i);
try {
Thread.sleep(1000); // thread to sleep for 1000 milliseconds
}    catch (Exception e) {
System.out.println(e);
} } }
public static void main(String[] args) throws Exception {
System.out.println(Thread.currentThread().getName());
Thread t = new Thread(new ThreadPrg1());
t.start();
Thread t2 = new Thread(new ThreadPrg1());
t2.start();
} }

shivendra gupta (to Everyone): 12:47: Thread-0 0


Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3
Naveen Kumar Mittal (to Everyone): 12:48: main
Thread-3 0
Thread-2 0
Thread-2 1
Thread-3 1
Thread-3 2
Thread-2 2
Thread-3 3
Thread-2 3

Shikhar Shukla (to Everyone): 12:48: main


Thread-1 0
Thread-0 0
Thread-1 1
Thread-0 1
Thread-1 2
Thread-0 2
Thread-0 3
Thread-1 3

APURV AGNIHOTRI (to Everyone): 12:48: main


Thread-0 0
Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3

Deep Shikhar Singh (to Everyone): 12:48: main


Thread-1 0
Thread-0 0
Thread-1 1
Thread-0 1
Thread-1 2
Thread-0 2
Thread-1 3
Thread-0 3
Atul Gupta (to Everyone): 12:48: main
Thread-0 0
Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3

Kushagra Gupta (to Everyone): 12:48: main


Thread-0 0
Thread-1 0
Thread-1 1
Thread-0 1
Thread-1 2
Thread-0 2
Thread-1 3
Thread-0 3
Abhishek Rana (to Everyone): 12:48: main
Thread-1 0
Thread-0 0
Thread-1 1
Thread-0 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3
AMAN SAXENA (to Everyone): 12:48: Thread-0 0
Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3

shivendra gupta (to Everyone): 12:48: main


Thread-0 0
Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3

Shipra Yadav (to Everyone): 12:48: main


Thread-1 0
Thread-0 0
Thread-1 1
Thread-0 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3
Unnati (to Everyone): 12:48: main
Thread-0 0
Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3

Shivaksh Ahalawat (to Everyone): 12:48: main


Thread-1 0
Thread-0 0
Thread-1 1
Thread-0 1
Thread-0 2
Thread-1 2
Thread-0 3
Thread-1 3

Harthik Ps (to Everyone): 12:48: main


Thread-0 0
Thread-1 0
Thread-0 1
Thread-1 1
Thread-1 2
Thread-0 2
Thread-0 3
Thread-1 3

MAYANK KUMAR (to Everyone): 12:49: main


Thread-0 0
Thread-1 0
Thread-0 1
Thread-1 1
Thread-1 2
Thread-0 2
Thread-1 3
Thread-0 3

Abhishek Kaushik (to Everyone): 12:49: main


Thread-0 0
Thread-1 0
Thread-0 1
Thread-1 1
Thread-0 2
Thread-1 2
Thread-1 3
Thread-0 3

Monica (to Everyone): 12:51: class MyThread extends Thread    {


public void run() {
for (int i=0; i<5 ; i++)
          System.out.println(Thread.currentThread().getName() + " in
control");
} }
public class ThreadPrg1    {
public static void main(String[]args) {
MyThread t = new MyThread();
t.start();
for (int i=0; i<5; i++) {
                                      System.out.println(Thread.currentThread().getName() + " in
control");
// Control passes to child thread
Thread.yield();
// After execution of child Thread main thread takes over
//System.out.println(Thread.currentThread().getName() + " in
control");
} }
}

Deep Shikhar Singh (to Everyone): 12:52: main in control


main in control
main in control
main in control
Thread-0 in control
main in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
Thread-0 in control

MAYANK KUMAR (to Everyone): 12:52: main in control


Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
Piyush Shukla (to Everyone): 12:52: main in control
main in control
Thread-0 in control
main in control
Thread-0 in control
Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control

Atul Gupta (to Everyone): 12:52: main in control


Thread-0 in control
main in control
Thread-0 in control
main in control
main in control
main in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
Akshay Singh (to Everyone): 12:53: main in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
main in control
main in control
main in control
main in control
Shivaksh Ahalawat (to Everyone): 12:53: main in control
main in control
Thread-0 in control
main in control
main in control
Thread-0 in control
main in control
Thread-0 in control
Thread-0 in control
Thread-0 in control

Kushagra Gupta (to Everyone): 12:53: main in control


main in control
Thread-0 in control
main in control
Thread-0 in control
Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
AMAN SAXENA (to Everyone): 12:53: main in control
main in control
Thread-0 in control
main in control
main in control
Thread-0 in control
main in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
Monica (to Everyone): 12:53: class MyThread extends Thread    {
public void run() {
for (int i=0; i<5 ; i++)
          System.out.println(Thread.currentThread().getName() + " in
control");
} }
public class ThreadPrg1    {
public static void main(String[]args) {
MyThread t = new MyThread();
t.start();
for (int i=0; i<5; i++) {
                                      System.out.println(Thread.currentThread().getName() + " in
control");
// Control passes to child thread
Thread.yield();
// After execution of child Thread main thread takes over
//System.out.println(Thread.currentThread().getName() + " in
control");
} }
}

APURV AGNIHOTRI (to Everyone): 12:54: main in control


main in control
Thread-0 in control
main in control
Thread-0 in control
main in control
main in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
Akshay Singh (to Everyone): 12:54: Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
main in control

Atul Gupta (to Everyone): 12:54: Thread-0 in control


Thread-0 in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
main in control
main in control
main in control
main in control
main in control
Shikhar Shukla (to Everyone): 12:54: main in control
main in control
main in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
main in control
main in control

Saloni Dhawan (to Everyone): 12:54: main in control


Thread-0 in control
Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
Thread-0 in control
main in control
main in control
Kushagra Gupta (to Everyone): 12:54: main in control
main in control
Thread-0 in control
main in control
Thread-0 in control
main in control
main in control
Thread-0 in control
Thread-0 in control
Thread-0 in control

shivendra gupta (to Everyone): 12:55: main in control


main in control
Thread-0 in control
main in control
Thread-0 in control
main in control
main in control
Thread-0 in control
Thread-0 in control
Thread-0 in control

Harthik Ps (to Everyone): 12:55: main in control


main in control
Thread-0 in control
main in control
Thread-0 in control
main in control
main in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
MAYANK KUMAR (to Everyone): 12:55: main in control
Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
AMAN SAXENA (to Everyone): 12:55: main in control
main in control
main in control
Thread-0 in control
Thread-0 in control
main in control
main in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
Naveen Kumar Mittal (to Everyone): 12:55: main in control
main in control
main in control
Thread-2 in control
Thread-2 in control
Thread-2 in control
Thread-2 in control
main in control
Thread-2 in control
main in control

Unnati (to Everyone): 12:56: main in control


Thread-0 in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
main in control
main in control
main in control
main in control

Saumya Vishwakarma (to Everyone): 12:56: main in control


Thread-0 in control
Thread-0 in control
main in control
Thread-0 in control
main in control
main in control
Thread-0 in control
main in control
Thread-0 in control

Piyush Shukla (to Everyone): 12:57: main in control


Thread-0 in control
Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
main in control
Thread-0 in control
main in control

Shivaksh Ahalawat (to Everyone): 12:57: main in control


main in control
main in control
Thread-0 in control
main in control
main in control
Thread-0 in control
Thread-0 in control
Thread-0 in control
Thread-0 in control

Monica (to Everyone): 13:02: public class ThreadPrg1 extends Thread {


public void run() {
System.out.println("Start.. ");
try { Thread.sleep(300); }
catch (InterruptedException ie) { }
System.out.println("End.. ");
}
public static void main(String[] args) {
ThreadPrg1 c1 = new ThreadPrg1();
ThreadPrg1 c2 = new ThreadPrg1();
System.out.println("Main Start.. ");
c1.start();
try {
c1.join(); // Waiting for c1 to finish
                              System.out.println("Main after join.. ");
} catch (InterruptedException ie) { }
c2.start();
System.out.println("Main Ends.. ");
} }

AMAN SAXENA (to Everyone): 13:02: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..

Saumya Vishwakarma (to Everyone): 13:02: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..

Piyush Shukla (to Everyone): 13:02: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..

Harthik Ps (to Everyone): 13:03: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..

Kushagra Gupta (to Everyone): 13:03: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..
Shikhar Shukla (to Everyone): 13:03: Main Start..
Start..
End..
Main after join..
Main Ends..
Start..
End..

Atul Gupta (to Everyone): 13:03: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..

Abhishek Rana (to Everyone): 13:03: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..
Saloni Dhawan (to Everyone): 13:03: Main Start..
Start..
End..
Main after join..
Main Ends..
Start..
End..
Ravi Pratap (to Everyone): 13:03: Main Start..
Start..
End..
Main after join..
Main Ends..
Start..
End..
Shivaksh Ahalawat (to Everyone): 13:03: Main Start..
Start..
End..
Main after join..
Main Ends..
Start..
End..

Mohit Rai (to Everyone): 13:03: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..

Akshay Singh (to Everyone): 13:03: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..

Deep Shikhar Singh (to Everyone): 13:03: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..

APURV AGNIHOTRI (to Everyone): 13:03: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..

MAYANK KUMAR (to Everyone): 13:03: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..
Abhishek Kaushik (to Everyone): 13:03: Main Start..
Start..
End..
Main after join..
Main Ends..
Start..
End..

Naveen Kumar Mittal (to Everyone): 13:04: Main Start..


Start..
End..
Main after join..
Main Ends..
Start..
End..
Abhishek Kaushik (to Everyone): 13:04: yes mam
Akshay Singh (to Everyone): 13:05: no mam
Unnati (to Everyone): 13:05: Main Start..
Start..
End..
Main after join..
Main Ends..
Start..
End..

Monica (to Everyone): 13:05: Topic: Reflection in Java


Presenter: Akshay Singh

Saumya Vishwakarma (to Everyone): 13:06: Thank you ma'am


Kushagra Gupta (to Everyone): 13:06: Thank You Ma'am
Naveen Kumar Mittal (to Everyone): 13:06: thank you ma'am
Chirag Yadav (to Everyone): 13:06: Thank you maam
Harthik Ps (to Everyone): 13:06: Thank you maam

Saloni Dhawan (to Everyone): 13:06: Thank you mam


Piyush Shukla (to Everyone): 13:06: Thank you Ma'am
Shikhar Shukla (to Everyone): 13:06: Thankyou ma'am
Abhishek Kaushik (to Everyone): 13:06: Thank you maam

Deep Shikhar Singh (to Everyone): 13:06: thank you ma'am


Unnati (to Everyone): 13:06: thanku mam
APURV AGNIHOTRI (to Everyone): 13:06: thank you mam

You might also like