I've found it helpful to get to know my neighbors. That way, if there are any volume issues, things are more likely to be settable amicably. Also, common sense--no loud music past 10, generally play at a moderate level, avoid boomy systems (e.g. even if your speakers are high quality, get them on the proper stands). I've been in dorms and then apartments for almost 20 years now. I've never had a complaint (except in the dorms, when my neighbor decided to try to blast me out of my room--being a man with a big stereo, well, one must retaliate).
I think that as more people get "home theater" systems with horrible, boomy subwoofers, people are getting more used to hearing their neighbor's music.
I've lived in college towns the whole time, so most of the people around me have been younger.