# AndroidJavaObject

> Construct an AndroidJavaObject based on the name of the class.

## Definition

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

## AndroidJavaObject(string, string\[])

Construct an AndroidJavaObject based on the name of the class.

```csharp
public AndroidJavaObject(string className, string[] args)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Specifies the Java class name (e.g. "\\\<tt\\>java.lang.String\\\</tt\\>" or "\\\<tt\\>java/lang/String\\\</tt\\>").**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): An array of parameters passed to the constructor.

### Remarks

This essentially means locate the class type, allocate an object and run the specified constructor.

## AndroidJavaObject(string, AndroidJavaObject\[])

Construct an AndroidJavaObject based on the name of the class.

```csharp
public AndroidJavaObject(string className, AndroidJavaObject[] args)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Specifies the Java class name (e.g. "\\\<tt\\>java.lang.String\\\</tt\\>" or "\\\<tt\\>java/lang/String\\\</tt\\>").**** (\[AndroidJavaObject\[]]\(/engine/6000.0/script-reference/unityengine/androidjavaobject)): An array of parameters passed to the constructor.

### Remarks

This essentially means locate the class type, allocate an object and run the specified constructor.

## AndroidJavaObject(string, AndroidJavaClass\[])

Construct an AndroidJavaObject based on the name of the class.

```csharp
public AndroidJavaObject(string className, AndroidJavaClass[] args)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Specifies the Java class name (e.g. "\\\<tt\\>java.lang.String\\\</tt\\>" or "\\\<tt\\>java/lang/String\\\</tt\\>").**** (\[AndroidJavaClass\[]]\(/engine/6000.0/script-reference/unityengine/androidjavaclass)): An array of parameters passed to the constructor.

### Remarks

This essentially means locate the class type, allocate an object and run the specified constructor.

## AndroidJavaObject(string, AndroidJavaProxy\[])

Construct an AndroidJavaObject based on the name of the class.

```csharp
public AndroidJavaObject(string className, AndroidJavaProxy[] args)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Specifies the Java class name (e.g. "\\\<tt\\>java.lang.String\\\</tt\\>" or "\\\<tt\\>java/lang/String\\\</tt\\>").**** (\[AndroidJavaProxy\[]]\(/engine/6000.0/script-reference/unityengine/androidjavaproxy)): An array of parameters passed to the constructor.

### Remarks

This essentially means locate the class type, allocate an object and run the specified constructor.

## AndroidJavaObject(string, AndroidJavaRunnable\[])

Construct an AndroidJavaObject based on the name of the class.

```csharp
public AndroidJavaObject(string className, AndroidJavaRunnable[] args)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Specifies the Java class name (e.g. "\\\<tt\\>java.lang.String\\\</tt\\>" or "\\\<tt\\>java/lang/String\\\</tt\\>").**** (\[AndroidJavaRunnable\[]]\(/engine/6000.0/script-reference/unityengine/androidjavarunnable)): An array of parameters passed to the constructor.

### Remarks

This essentially means locate the class type, allocate an object and run the specified constructor.

## AndroidJavaObject(string, Object\[])

Construct an AndroidJavaObject based on the name of the class.

```csharp
public AndroidJavaObject(string className, params object[] args)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Specifies the Java class name (e.g. "\\\<tt\\>java.lang.String\\\</tt\\>" or "\\\<tt\\>java/lang/String\\\</tt\\>").**** (\[Object\[]]\(https\://learn.microsoft.com/dotnet/api/system.object)): An array of parameters passed to the constructor.

### Remarks

This essentially means locate the class type, allocate an object and run the specified constructor.

## AndroidJavaObject(IntPtr)

Create AndroidJavaObject for existing Java object.

```csharp
public AndroidJavaObject(IntPtr jobject)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): A reference to existing Java object.

### Remarks

Does not take ownership of passed reference, you still have to delete it.

## AndroidJavaObject(IntPtr, IntPtr, Object\[])

Create AndroidJavaObject (and it's Java counterpart) using given Java class and constructor.

```csharp
public AndroidJavaObject(IntPtr clazz, IntPtr constructorID, params object[] args)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): A pointer to Java class.**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): A method ID for the constructor to be used.**** (\[Object\[]]\(https\://learn.microsoft.com/dotnet/api/system.object)): An array of parameters passed to the constructor.
