How are you
package com.kangjia; | |
import java.util.Arrays; | |
public class Ha { | |
public String[] changeLocation(String[] data){ | |
String temp=""; | |
for(int i=0;i | |
temp=data[i]; | |
data[i]=data[data.length-i-1]; | |
data[data.length-i-1]=temp; | |
} | |
return data; | |
} | |
public static void main(String[] args) { | |
String[] data = new String[3]; | |
data[0]="how"; | |
data[1]="are"; | |
data[2]="you"; | |
System.out.println( Arrays.toString(new Ha().changeLocation(data))); | |
} | |
} |