[yes i knew ob1 is a instance of class of NewThread1 which doesn't have isAlive(), this might be the reason]
Absolutely correct.
so here there are calling isAlive method using both reference variables rite, thats what questioning me! why use of both reference variables? can some one explain this concept generally?
Such multiple dots references should be evaluated from left to right.
You can invoke isAlive on a thread variable. So you want to do this.
threadReference.isAlive();
Now threadReference you do not have in your DemoJoin class. Where is the Thread variable? In your NewThread1 class, right. How do you access NewThread1 instance variables inside DemoJoin. instance variable.the variable you require / instance variable.getVariable().
Since you don't have a getter, your threadReference, i.e (t) becomes
object reference.variable reference ( obj1.t ).
Replace that in the threadReference.isAlive(), and you get
ob1.t.isAlive()
this is what i understood. ob1 is an object contains which contains Thread type reference variable i.e t, since ob1 is instance of class NewThread1 which doesn't have isAlive(), join methods and those are present in Thread class and those can be accessible by Thread reference which is 't' here. so we are calling those methods as ob1.t.isAlive() and ob1.t.join(). am i rite?
You know it is 'right', not 'rite'. Right?
And yes, you're right.
Chan.