Java preserve order of methods when compiling [duplicate]

How can I preserve order of private methods when compiling java classes? I use getDeclaredMethods() and it returns an incorrect order.


Solution 1:

As Sotirios Delimanolis says in comments, you cannot ensure order. For more details, please see this question that has already been answered.