Step-by-step explanation:
at this point in the play, Francisco is at his watch. Barnardo comes upon him to relieve him from the watch for the night, but Francisco cannot tell that it's Barnardo also cannot tell watch so he first asks "who is there?" Francisco, since he's on duty, replies asking Barnardo to identify himself, or explain himself, first.