I have method that should at the end to the same process but the can get diffrent parameters
since the need to do that process in different way
my question is this is the best way to do that assuming that this is the APIs
void action(String a,String b){
functionA();
functionB();
functionC();
}
void action(String a){
functionA();
functionC();
}
void action(String a,String B,String C){
functionA();
functionC();
functionD();
}
the reason that I ask that is as you can see I always use functionA and functionC?
There is more elegant way to do that in java?
You can share code between overloaded functions, it is very logical for overloaded function to share code between them.