Let's use only the relevant (for your question) part of code ( formatted so it's easier to read):
The two threads you start at line 11 and 12 do not use your current ChickYack instance you create at line 10.
Each creates its own, new instance: new Thread(new ChickYack()) ...
Since c is only declared (line 3) => it has the default value which is null.
That means, at line 16 c is null => a NullPointerException will be thrown.
Joined: Feb 05, 2009
Thanks for your reply .... I think i got the explanation.
Since it creates entirely new objects(in line 11,12) c will be null for these objects.
Thanks again ..
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: SCJP 1.6 ...Threads. Needs clarification of a Self Test ans from K&S Book