public function invokeMethod(?Interfaces\JavaType $object = null, string $method, array $args = [])
    {
        $id = ($object === null) ? 0 : $object->__getJavaInternalObjectId();

        return self::getClient()->invokeMethod($id, $method, $args);
    }
public function invokeMethod(?Interfaces\JavaType $object = null, string $method, array $args = [])
    {
        $id = ($object === null) ? 0 : $object->__getJavaInternalObjectId();

        return self::getClient()->invokeMethod($id, $method, $args);
    }
public function invokeMethod ( ? Interfaces \ JavaType $ object = null , string $ method , array $ args = [ ] ) { $ id = ( $ object === null ) ? 0 : $ object -> __getJavaInternalObjectId ( ) ; return self :: getClient ( ) -> invokeMethod ( $ id , $ method , $ args ) ; }
Invoke a method dynamically.

Example:
<code>
$bigint1 = new Java('java.math.BigInteger', 10);
$bigint2 = new Java('java.math.BigInteger', 20);
$bigint3 = PjbProxyClient::invokeMethod($bigint, "add", [$bigint2])
</code>

<br> Any declared exception can be caught by PHP code. <br>
Exceptions derived from java.lang.RuntimeException or Error should
not be caught unless declared in the methods throws clause -- OutOfMemoryErrors cannot be caught at all,
even if declared.

@throws \Soluble\Japha\Bridge\Driver\Pjb62\Exception\BrokenConnectionException

@param Interfaces\JavaType|null $object a java object or type
@param string                   $method A method string
@param array                    $args   Arguments to send to method

@return mixed
Invoke a method dynamically .