File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "this argument question" Watch "this argument question" New topic

this argument question

Arnold Tieu

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 )
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
I agree. Here's the link:
subject: this argument question
It's not a secret anymore!