A
antonyliu2002
I've been puzzled by this for a long time.
Say if I define a method as follows:
// methodA returns a String
public String methodA(some arguments)
{ // do something and return a String
}
Now suppose, another method (methodB) will use the String returned from
methodA. Should I call methodA inside methodB in order to get the
String, or should I call methodA outside methodB (in the main) and pass
the returned value to methodB as an argument?
Which approach is considered better according to you professional
programmers/developers? What are the differences?
Thanks.
Say if I define a method as follows:
// methodA returns a String
public String methodA(some arguments)
{ // do something and return a String
}
Now suppose, another method (methodB) will use the String returned from
methodA. Should I call methodA inside methodB in order to get the
String, or should I call methodA outside methodB (in the main) and pass
the returned value to methodB as an argument?
Which approach is considered better according to you professional
programmers/developers? What are the differences?
Thanks.