See javadocs for wait - "This method causes the current thread to place itself in the wait set for this object and then to relinquish any and all synchronization claims on this object"
Adding the wait outside of the synchronized block causes a runtime exception for illegal monitor state