When using optional parameters and named arguments in a class hierarchy, is there a way to avoid duplicating default values in subclasses?
class A {
A(int foo = 2, String bar = "bar"){ ... }
}
class B extends A {
B(int foo = 2, String bar ="bar", long fooBar = 5L){
super(foo, bar);
...
}
}
In this example, the default values for foo and bar must be repeated in both class A and B.