You missed the best methods, Kamamer
The best method is to email the developer if it is a question that needs to be answered in the next hour or so. I personally have found that they appreciate this approach if you note in the email that you had stopped by, but he/she looked very busy.
The second method is to put the question on a post-it note and pop it on their cubicle entrance or a bulletin board near their entrance.
You should try to avoid using the telephone unless it is a vital immediate question. The intrusive ringing tends to occur exactly when the programmer has just figured out how to kill a difficult bug in the code, and it will cause said programmer to lose this nugget of information. Neither of you will be happy with the results.
If it is an immediate question, then Kamamer's suggestions should be followed. Expect to stand about ten minutes. Bring something to read to avoid the throat-clearing and sighs. Pick and choose when to intrude on their environment. If you only bug them when it is truly important, they will do their best to help you out with accurate information as fast as possible.