Override constructor
Is it possible to override a constructor?
I want to take my code:
and translate it to:
In the example, I add a private field
age
, but if it's not possible it's ok, I'll be happy with just overriding the constructor1 Reply
You cannot litterally override a constructor, however you can add statements at the beginning of it, so your use case can be covered. This is called an initializer. See https://doc.metalama.net/conceptual/aspects/advising/initializers.