Non-static variable s caused incorrect accumulation of reversed characters. Overwriting value in the loop meant only the last reversed string was printed. Here is the corrected version reverses each string in the array in-place and prints the entire reversed array.
public class ReverseStringArray { public static void main(String[] args) { String[] array = {"ABCD", "EFGH", "IJKL", "MNOP"}; for (int i = 0; i < array.length / 2; i++) { String temp = array[i]; array[i] = array[array.length - 1 - i]; array[array.length - 1 - i] = temp; } for (String str : array) { System.out.print(str + " "); } } }You can find the more details on this link where I shared.