Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started