Consider multiple threads are trying to access critical section, what will happen one thread that occurs Exception inside a synchronized block it having wait() and notify() to
Probably you are thinking of locks in the same way as resources(Connections, I/O) but unlike resources lock will be released as soon as the executing Thread reaches the exit boundary of critical section(monitor/ synchronized block closing parenthesis) regardless of Exception being thrown.
Refer: synchronized statement
If execution of the Block completes abruptly for any reason, then the monitor is unlocked and the synchronized statement completes abruptly for the same reason.