# ToObjectArray

> Converts a managed array of System.IntPtr, representing Java objects, to a Java array of \<tt\>java.lang.Object\</tt\>.

## Definition

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

## ToObjectArray(IntPtr\*, int, IntPtr)

Converts a managed array of System.IntPtr, representing Java objects, to a Java array of \\\<tt\\>java.lang.Object\\\</tt\\>.

```csharp
public static IntPtr ToObjectArray(IntPtr* array, int length, IntPtr arrayClass)
```

### Parameters

**** (\[IntPtr\*]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)):&#x20;

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) |             |

### Remarks

Additional Resources: [AndroidJNI.NewObjectArray](/engine/6000.0/script-reference/unityengine/androidjni/newobjectarray.md), [AndroidJNI.SetObjectArrayElement](/engine/6000.0/script-reference/unityengine/androidjni/setobjectarrayelement.md).

## ToObjectArray(IntPtr\[], IntPtr)

Converts a managed array of System.IntPtr, representing Java objects, to a Java array of \\\<tt\\>java.lang.Object\\\</tt\\>.

```csharp
public static IntPtr ToObjectArray(IntPtr[] array, IntPtr arrayClass)
```

### Parameters

**** (\[IntPtr\[]]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): **** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)):&#x20;

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) |             |

### Remarks

Additional Resources: [AndroidJNI.NewObjectArray](/engine/6000.0/script-reference/unityengine/androidjni/newobjectarray.md), [AndroidJNI.SetObjectArrayElement](/engine/6000.0/script-reference/unityengine/androidjni/setobjectarrayelement.md).

## ToObjectArray(IntPtr\[])

Converts a managed array of System.IntPtr, representing Java objects, to a Java array of \\\<tt\\>java.lang.Object\\\</tt\\>.

```csharp
public static IntPtr ToObjectArray(IntPtr[] array)
```

### Parameters

**** (\[IntPtr\[]]\(https\://learn.microsoft.com/dotnet/api/system.intptr)):&#x20;

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) |             |

### Remarks

Additional Resources: [AndroidJNI.NewObjectArray](/engine/6000.0/script-reference/unityengine/androidjni/newobjectarray.md), [AndroidJNI.SetObjectArrayElement](/engine/6000.0/script-reference/unityengine/androidjni/setobjectarrayelement.md).
