Array setBoolean() Method in Java with Examples

The java.lang.reflect.Array.setBoolean() method is an inbuilt method used to set a specified Boolean value to a specified index of a given object array.

Syntax:

Array.setBoolean(Object []array, int index, boolean value)

Parameter: This method takes three parameters:

  • array: array of type Object which is to be updated.
  • index: index of the array which is to be updated.
  • value: boolean value that is to be set at the given index of the given array.

Return type: This is a void type method and doesn’t returns any value. The update reflects upon the Object array passed as the argument.



Exception: This method throws following exceptions: