Cockiness and confidence are basically two very different things.
Cocky people: Usually don't listen to what other got to say, talk too much, can be very mean to others without any reason, act like they own everything, talk very much about them selfs and such on. What you can call a a**hole, if you don't know them or do.
Confident people: Talk with everyone about everything without any problems, have no problems meeting new people and act like they have known them for a long time, is always 'out there' and enjoys it, have a great-self image, doesn't take anything bad said about them personal, laughs when someone say something bad about them if its not an assault.
I hope you get the picture, if you act like you are all better then everyone you are probably cocky, which is people I don't like. Cocky + funny is great, but just cocky is being a a**hole.