Eclipse organize methods in alphabetical order

后端 未结 4 1603
感情败类
感情败类 2020-12-09 07:50

I have a large class that contains about 30 methods. Is it possible to automatically sort them in alphabetical order in eclipse? I was hoping to do this so they would be e

4条回答
  •  攒了一身酷
    2020-12-09 08:19

    Press the Sort button in the Outline view. It has A, Z, and an arrow in it.

    I wouldn't modify the Java source if I were you. If you're using an IDE such as Eclipse, then this adds no benefit, and there are a few costs, including:

    1. If the code already is checked in to source control, then resorting it can break the history
    2. I've never heard of a group with a coding convention of sorting methods alphabetically

提交回复
热议问题