Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
static methods in class Thread like sleep(), currentThread(),when we write them in our code, they could know the running thread object. How ?? Why a static method can access an object of its own class ??
currentThread(), sleep() etc contain native method calls to perform their respective functions. That's y there are static (they dont access any instance variable or methods).
Iam not sure I understand ur second question, >Why a static method can access an object of its own class ?? well, why not, if the class has a stic variable of same type as the class, why not ?
look at code below.
though u would want to take a good hard look at ur design to decide if theresnt a better way to do this.