• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what does this mean?

 
Calanthe Wei
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Thanks.

ps:
Pl use the [ code ] opening and closing tags (without the spaces) when posting source code.
Thanks.
- satya
[ February 09, 2002: Message edited by: Madhav Lakkapragada ]
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marilyn,
i guess calanthe is asking about that Test.class part of wait()...is 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.
regards
maulin
 
aymen esawey
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i've asked a Q like that before
here is the thread
http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=24&t=014558
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic