# CallStaticObjectMethod

> Invokes the specified \<tt\>methodID\</tt\> static method on a Java object, optionally passing in an array of arguments (\<tt\>args\</tt\>).

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/7000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AndroidJNIModule

## CallStaticObjectMethod(IntPtr, IntPtr, jvalue\[])

Invokes the specified \\\<tt\\>methodID\\\</tt\\> static method on a Java object, optionally passing in an array of arguments (\\\<tt\\>args\\\</tt\\>).

```csharp
public static nint CallStaticObjectMethod(nint clazz, nint methodID, jvalue[] args)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): The Java class on which to call the static method.**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): The ID of the method to call.**** (jvalue\[]): An array of arguments to pass to the method.

### Returns

| Type                                                           | Description                                                  |
| -------------------------------------------------------------- | ------------------------------------------------------------ |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) | A local reference to the Java object returned by the method. |

### Remarks

This method returns a reference to a \\\<tt\\>java.lang.Object\\\</tt\\>, or a subclass thereof.

Additional Resources: [Java Native Interface Specification (Oracle)](http://download.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html)

## CallStaticObjectMethod(IntPtr, IntPtr, Span\<jvalue>)

Invokes the specified `methodID` static method on a Java object, optionally passing in an array of arguments (`args`).

```csharp
public static nint CallStaticObjectMethod(nint clazz, nint methodID, Span<jvalue> args)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): The Java class on which to call the static method.**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): The ID of the method to call.**** (\[Span\<jvalue>]\(https\://learn.microsoft.com/dotnet/api/system.span-1)): An array of arguments to pass to the method.

### Returns

| Type                                                           | Description                                                  |
| -------------------------------------------------------------- | ------------------------------------------------------------ |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) | A local reference to the Java object returned by the method. |

### Remarks

This method returns a reference to a `java.lang.Object`, or a subclass thereof.

Additional Resources: [Java Native Interface Specification (Oracle)](http://download.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html)
