Given the following context

John was doing research in the library when he heard a man humming and whistling. *He* was very annoyed.

Are "John" and "He" the same?
yes