Hi,
This is from k&b threads,selftest(pgno:768,qno:13)
1.new Starter().run();
2.new Starter().start();
3. new Thread(new Starter());
4. new Thread(new Starter()).run();
5. new Thread(new Starter()).start();
if we place the above statements at line 1 in code which is true?
answers are:
c.only one might produce the output 4 2
d.exactly two might produce the output 4 4
my doubt is how can we find out the answer ? i run the above code
for 4 i got output-- 1 1
for 5 i got output--1 8
i am using 1.6 version. i am confusing which is correct ? how?
please any body explain me step wise