'Creates a Java array of type `java_class` of `dimensions`
:param java_class: The :class:`JavaClass` instance representing the
type of the array.
:param dimensions: A list of dimensions of the array. For example
`[1,2]` would produce an `array[1][2]`.
:rtype: A :class:`JavaArray <py4j.java_collections.JavaArray>`
instance.'

def new_array(self, java_class, *dimensions):

    if (len(dimensions) == 0):
        raise Py4JError(u'new    arrays    must    have    at    least    one    dimension')
    command = ((proto.ARRAY_COMMAND_NAME + proto.ARRAY_CREATE_SUB_COMMAND_NAME) + get_command_part(java_class._fqn))
    for dimension in dimensions:
        command += get_command_part(dimension)
    command += proto.END_COMMAND_PART
    answer = self._gateway_client.send_command(command)
    return get_return_value(answer, self._gateway_client)
