This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
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
Similar Threads
Is initializing mem vars proper
how to call a stored procedure which do not return a resultSet
New EJB3 Oracle certificate
Issue with Jsp's multiple request going to same jsp
some API related doubt.