Originally posted by sandeep Talari:
ok fine , happy with your answer but ,Here "this" is passed in the constructor of the actual object which we call "new thread(this)" .Please explain what does it mean.
Just to be sure, the object isn't called (or named) "new Thread(this)".
Thread : (the first one) is the name of the class of which you want to instantiate an object (you create an object based on that class).
t : This is the name of the reference variable that you use to access the object. t is not the object itself, but you use the variable to access the object (a bit like a remote control for your TV, sort of).
new : This is the keyword that you use to create new objects.
Thread : The name of the contructor that you call. A constructor's name is the same as the class' name.
this: The value that you pass to the constructor. By doing this, you pass a reference to the 'current object' (as you call it) to the constructor.
A bit more info on 'this':
http://java.sun.com/docs/books/tutorial/java/javaOO/thiskey.html [ June 10, 2008: Message edited by: Ronald Schild ]