IJavaClass::AddField

Use this method to add a field class member.

Syntax

HRESULT AddField(
[in] JavaMemberModifiers mods,
[in] BSTR pType,
[in] BSTR bstrName,
[in] BSTR bstrInitializer,
[in] long nIndex,
[out, retval] IJavaField** retval
);

Function AddField(ByVal mods As Long, ByVal pType As String, ByVal bstrName As String, ByVal bstrInitializer As String, ByVal nIndex As Long) As IJavaField

Parameters

mods

Modifiers for the new field.

pType

The type signature for the type of the new field.

bstrName

The name of the new field.

bstrInitializer

The initial value expression for the new field. Can be Null.

nIndex

The index of the existing member before which the new field should be inserted. To insert the new field at the end of the class, pass –1 as the index.