aspose file tools*
The moose likes Beginning Java and the fly likes this argument question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "this argument question" Watch "this argument question" New topic
Author

this argument question

Arnold Tieu
Greenhorn

Joined: Feb 24, 2003
Posts: 2
Hi I am new to this site..Please help me with the question below...
What does "this" references. For example
synchronize( RAndomCharacters.this )
and
RandomCharacters.this.wait();
and
this.a
I am confused by all these...
[ February 24, 2003: Message edited by: Arnold Tieu ]
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Arnold,
this references any object created by new HelloAnimThreadFirst() or any other constructed object for that matter. The code you posted is incorrect because the line new Thread(this) would have to be inside the class.
Michael Morris
[ February 24, 2003: Message edited by: Michael Morris ]

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: this argument question