aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes what does this mean? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "what does this mean?" Watch "what does this mean?" New topic

what does this mean?

Calanthe Wei
Ranch Hand

Joined: Oct 27, 2001
Posts: 42
See code bellow:

My question is what doees Test.class.wait(1000) mean? I never see this kind of code before.
Can someone give me some explanation?

Pl use the [ code ] opening and closing tags (without the spaces) when posting source code.
- satya
[ February 09, 2002: Message edited by: Madhav Lakkapragada ]
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9055
void wait(long timeout)
Causes current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
Hi Marilyn,
i guess calanthe is asking about that Test.class part of wait() it calanthe?
if so then i only know that thats the way u can have static blocks synch etc.
e.g. in a static method say m() we want to have synch block and the class is Test then we 'll do sth like,
static void m() {
synchronized(Test.class) {
// code goes here..
this is so as we cant use "this" ref in the static methods and so we can write synchronized(this) in the m() method.
Still i need to know what Test.class means here.
aymen esawey
Ranch Hand

Joined: Jan 29, 2002
Posts: 61
i've asked a Q like that before
here is the thread

Aymen Esawey<br />SCJP <img src="smile.gif" border="0"> <br /><a href="" target="_blank" rel="nofollow">how to nuke the SUN </a>
Consider Paul's rocket mass heater.
subject: what does this mean?