public static void main(String[] args) { String[] strs = {"y", "a", "n", "g","f","e","i"}; System.out.println(Arrays.toString(strs)); swap(strs); System.out.println(Arrays.toString(strs));
}
public static void swap(String strs[]) { int len = strs.length; int as = len / 2; for (int i = 0; i < as; i++) { String tmp = strs[i]; strs[i] = strs[len - 1 - i]; strs[len - 1 - i] = tmp; } }