The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.lang.reflect  [17 examples] > Arrays  [6 examples]

e125. Getting and Setting the Value of an Element in an Array Object

    // Get the value of the third element.
    Object o = Array.get(array, 2);
    
    // Set the value of the third element.
    Array.set(array, 2, newValue);

 Related Examples
e120. Determining If an Object Is an Array
e121. Getting the Length and Dimensions of an Array Object
e122. Getting the Component Type of an Array Object
e123. Creating an Array
e124. Expanding an Array

See also: Constructors    Fields    Methods    Modifiers   


© 2002 Addison-Wesley.