It's a bit more long-winded, but you can achieve the same effect with multiple constructors:
C++
thing(int required, int optional = 3) {
field1 = required;
field2 = optional;
}
Java
thing(int required, int optional) {
field1 = required;
field2 = optional;
}
thing(int required) {
this(required, 3);
}
[This second form works in C++ too!]
Peter
Vote for answers, and mark them accepted if you like them.