This has happened to me occasionally (but regularly enough) to me my whole life. I'll just be walking down the street, minding my own business, and some strange guy passing by me will say "hi." I'm usually too taken aback to give much of a response but I'll try to nod my head in acknowledgment or quickly say hi back. But I don't understand this behavior. You could say he's just being friendly, but women never do this. But it doesn't seem like a sexual thing otherwise; I don't think these guys are trying to hit on me; I'm literally passing by so there's no chance for a conversation. Which doesn't make sense to me either; why bother trying to be friendly with a stranger when there's absolutely no chance they're going to stop and talk to you?
Can someone explain this? What's the appropriate way for me to react in this situation?