I'm calling a Java method from another language (R). Some of the parameters are optional in my R function. What's the best way to handle uninitialized parameters in a Java method? (Ideally without using exception handling...)
Edit: Follow-up based on the first response:
"2.Initialize with predefinied defaults and continue"
How can I check if something isn't initialized?
Here's some pseudo code of the approach I was hoping to use:
public static void test(int i) {
if(!is.initialized(i) {
i = 0;
}
// Do stuff with i
}
Edit 2: Overloading seems like a lot of work. I'd rather have one method and handle each case with defaults. That said, I'm not an expert and would love to learn what the best practice is here.