For some reason, I'd like to add a couple words of my own to this thread.
I know it's been said already, from the start, but let me emphasize it again.
Chances are, if you are good friends with a guy, if you like him and you've spent time with him, you will know. You probably won't be certain (and unless you ask, there is no other way to be certain), but you should have a good idea. Usually, you will have hung out quite a bit and unless he's obviously shown signs of no interest, then you should have a pretty decent feel of whether or not he likes you. Give it time and you'll figure things out. If the guy spends time with a bunch of other girls as well who are his close friends, it's a little tougher but still. You should be able to recognize the details. Girls tend to pick up on a lot of them.
If you're a guy and you like a girl, generally the same rules apply. Girls like confident guys and if you've hung out with her quite a bit and she doesn't have a boyfriend or have shown interest in other guys, you should have a good feeling as to whether or not she likes you.
Disclaimer: This is for people who are actually seeking relationships. Physical attraction is something different.