package com.home.test;
import java.util.Arrays;
public class ChangeSort {
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 ChangeSort().changeLocation(data))); // String[] a=new ChangeSort().changeLocation(data); // for(String i:a){ // System.out.print(i+" "); // } } }