T
Telmo Costa
What should i call the functions named Factorial_ in this sample code:
class SomeClass {
...
public int Factorial(int f) {
if (f<0) throw SomeException("Some message.");
if (f==0 || f==1) return 1;
return Factorial_(f);
}
private int Factorial_(int f) {
if (f==1) return 1;
return f*Factorial_(f-1);
}
...
}
Calling it Factorial_ looks bad. Cannot call Factorial because it is the
name that the public method should have. What should it be?
telmo
class SomeClass {
...
public int Factorial(int f) {
if (f<0) throw SomeException("Some message.");
if (f==0 || f==1) return 1;
return Factorial_(f);
}
private int Factorial_(int f) {
if (f==1) return 1;
return f*Factorial_(f-1);
}
...
}
Calling it Factorial_ looks bad. Cannot call Factorial because it is the
name that the public method should have. What should it be?
telmo