I get how to create an anonymous class
class A {}
class B {
A anonymous = new class A { ... };
}
But if A has a constructor, and no default constructor.
class A {
init(string someArg) {
}
}
class B {
A anonymous = new class A { ... };???
}
How do I pass the parameter to that constructor?
Just implement a default constructor which calls the parent constructor with
super
: