2) Which method gets executed when the start() method of Thread class is called? [2] [6+4) 8 9 3) a. What will be the ou

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

2) Which method gets executed when the start() method of Thread class is called? [2] [6+4) 8 9 3) a. What will be the ou

Post by answerhappygod »

2 Which Method Gets Executed When The Start Method Of Thread Class Is Called 2 6 4 8 9 3 A What Will Be The Ou 1
2 Which Method Gets Executed When The Start Method Of Thread Class Is Called 2 6 4 8 9 3 A What Will Be The Ou 1 (198.75 KiB) Viewed 18 times
2) Which method gets executed when the start() method of Thread class is called? [2] [6+4) 8 9 3) a. What will be the output of the following program? b. Which functionality of Thread is violated in this code? How? 1 package ct5; 2 3 public class TestThread { 4 50 public static void main(String[] args) throws InterruptedException { 6 Thread t1 = new MyThread(); 7 Thread t2 = new MyThread(); Thread t3 = new MyThread(); t1.start(); 10 t1.join(); 11 t2.start(); 12 t2.join(); 13 t3.start(); 14 t3.join(); 15 System.out.println("Done"); 16 } 17 } 18 19 class My Thread extends Thread{ 200 public void run() { 21 for(int i=1; i<=5; i++) 22 System.out.println(Thread.currentThread().getName()+":"+i); 23 } 24 )
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply