What is the most common way of ordering Java methods?
问题 Ordering Java methods is probably the least important code style issue ever, but I'm trying to develop a code style as similar to what most people do as possible. It's by far the most popular approach to first declare all fields and then all methods, so I'll only ask about methods. Now I'm wondering how to order Java methods. I can think of two sensible basic approaches: Order methods by visibility (i.e. first public, then protected, then private or the other way around) Order methods by