Compare this method:
void doStuff(String val) { if (val == null) { val = DEFAULT_VALUE; } // lots of complex processing on val }
In my experience, the use of null as a sentinel for the default parameter is more of an idiom in Python. In Java, you can just overload the method.
null
void doStuff() { doStuff(DEFAULT_VALUE); } void doStuff(final String val) { assert (val != null); // or whatever ... }