ex. 32.5 What is wrong with the following two programs? Correct the errors. (1)
ID: 3658629 • Letter: E
Question
ex. 32.5 What is wrong with the following two programs? Correct the errors. (1) public class Test implements Runnable { public static void main(String args[]) { new Test(); } } public Test() { Test task = new Test(); new Thread(task).start(); } public void run() { System.out.println("test"); } (2) public class Test implements Runnable { public static void main(String args[]) { new Test(); } } public Test() { Thread t = new Thread(this); t.start(); t.start(); } public void run() { System.out.println("test"); }Explanation / Answer
can you please paste clean code its unreadable hard to check syntax too
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.