Is there a standard practice or convention on where to declare methods which are used(or called) only inside another methods? To demonstrate this assume the following:
public class MyClass{
methodA();
methodB();
methodC();
public void methodA(){
methodA1();
methodA2();
}
public void methodB(){
methodB1();
methodB2();
}
private void methodA1(){
do something;
}
private void methodA2(){
do something;
}
}
Or, is there a different way of codding that could improve the readability of the above? I have read other questions with similar topics but they don't address my question which is specific on mothods which are used inside other methods. You may assume that methodA, methodB, and methodC have logical and meaningful sequence for a specific task. My problem is that the other methods(methodA1, methodA2,..) does not give sense in this task, they give sense only inside the methods they are called. Or, should I not be bothered on where to place method declarations at all?