What will be the output of following code: class Printer extends Thread{ private int max = 0; public Printer(int max){ this.max = max; } public void run() { for(int i=1; i<=max; i++){ System.out.println(i); } } public static void main(String[] args){ Printer printer1 = new Printer(3); Printer printer2 = new Printer(2); printer1.start(); printer2.start(); } }
Correct Answer: 1 2 1 2 3
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Java MCQ Questions