Hey is an interjection use as an informal greeting, as an expression of surprise, and in other contexts.