Online Java Compiler By
JavaTpoint.com
//import statement import java.lang.reflect.Array; public class ReflectArraySetExample1 { public static void main(String[] args) { String s[] = { "Java", "T", "Point" }; System.out.print("Before Setting : "); for (String x : s) { System.out.print(x); } Array.set(s, 1, "for"); System.out.print("\nAfter Setting : "); for (String x : s) { System.out.print(x); } } }
Output