# AllocObject(nint)

> Allocates a new Java object without invoking any of the constructors for the object.

## Definition

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

## AllocObject(IntPtr)

```csharp
public static nint AllocObject(nint clazz)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): The Java class to instantiate.

### Returns

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

### Remarks

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