Question: What print after the thread end? public class Quiz { public static void main(String[] args) { new Thread(new Task1()).start(); System.out.print(1); } } class Task1 implements

 What print after the thread end? public class Quiz \{ public

What print after the thread end? public class Quiz \{ public static void main(String[] args) \{ new Thread(new Task1()).start(); System.out.print(1); \} \} class Task1 implements Runnable \{ @Override public void run() \{ int count =3 int answer =1 while (count > 0) \{ try{ Thread.sleep(1000); \} catch (InterruptedException e) \{ e.printStackTrace(); \} count--; answer++; \} System.out.print(answer); \} \}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!