Hi ragi,
if you use synchronized block then scope of synchronization remains on block boundary e.g.
synchronized (System.in){
//some code
}
though points to remember
1)
Java supports re entrant entry , so if a thread calls another synchronized method (which synchronize on same object whose lock calling thread holds) it will go there without waiting because it holds the lock.
2) Thread acquire lock before entering synchronized block/method and releases lock when they leave block (either normal or due to exception).
Thanks
Javin