String [] reverse = {"a", "b", "c", "1", "2", "3"};
for ( String forward : reverse )
System.out.print ( forward + " ");
for ( int j = 0; j < array.length ; j++){
//j = last index of reverse -1 everytime this loops
reverse[i] = reverse[j]
}
I need to find a way to get values for primitive j? I've considered doing a nested for loop but that will result in too many loops. I could just do it manually by I want to do it efficiently as possible especially if I start to use longer strings.
(array.length)/2, a temp String variable and 3 assignment operations will do it for you :)AlexR'sanswer.