klyn.reflection.Constructor.invoke
method
public invoke(args... as Object) as Object throws Exception:
Description

Invokes the constructor with a direct argument list.

This overload is convenient for reflective code that mirrors a normal constructor call. Arguments are packed in an Object[] before delegating to the native reflection dispatcher.

Parameters
ParameterDescription
argsConstructor arguments.
Returns

New instance.

Throws
  • Exception if argument binding or constructor execution fails.
Example
user = User.type.getConstructor().invoke("Alice", 42) as User