klyn.reflection.Constructor.invoke
method
public native invoke(args as Object[]) as Object throws Exception
Description

Invokes the constructor with dynamic arguments packed in an Object[].

Parameters
ParameterDescription
argsConstructor arguments as an Object[].
Returns

New instance.

Throws
  • TypeError if the declaring type is abstract or an interface, or the constructor is inaccessible or the arguments do not match.
  • NullException if null is passed to a non-nullable parameter.
  • Exception if argument binding or constructor execution fails.
Example
constructorArgs as Object[] = Object[0]
user = User.type.getConstructor().invoke(constructorArgs) as User