Is the following output possible ?
i think it is possible.
both threads lock on same instance,so they would block each other
any one either main or thread-0 thread-1 can run first
but i think jvm can stop
thread 0 in between and run main and then switch back to thread-0
jusbeforesleep
Thread-0
main
Thread-0
jusbeforesleep
Thread-1
Thread-1