wood burning stoves*
The moose likes Beginning Java and the fly likes Query: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Query:" Watch "Query:" New topic
Author

Query:

shailesh Jammie
Greenhorn

Joined: Nov 14, 2005
Posts: 11
hi all,
i m new to java. I have a doubt a snipplet. weather it will work fine or not ?
can some one suggest me?


private Object[] a;

public synchronized void find(Object key)
{
find(key);
}


in this code i m using the method synchronized and calling the same method
recursivly. my doublt is weather this code will run fine or run with some run time exception.


thanks in advace..
Shailesh
[ January 27, 2006: Message edited by: shailesh Jammie ]
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Try it and see. What did you discover?


There is no emoticon for what I am feeling!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Query:
 
Similar Threads
Synchronization
Redundant synchronization?
is other method also synchronized
monitor question
Threads