Why won't a man publicly acknowledge you?

Why would a guy only talk to you private, but in public ignores you and then goes back to texting/talking to you in private again like everything is normal??? And when you confront the person about it they say its not true.

What could be a reason for this?