I am looking to print out my original unsorted array, I have it printing in order and sorted but I can't seem to get the original one to print out unsorted. I have used printRuleAndArray(String rule) and I have also used LengthCompare for the new sorted array, my problem is the original!!!
import java.util.*;
import java.util.Arrays;
// Example of how to sort an array
public class Sorting2
{
//declare an array of strings
static String[] nameArray = {"Alan", "Peter", "Ed", "Stephen", "Pheadraa"};
public static void main(String[] args)
{
// sorting by length
Arrays.sort(nameArray, new LengthCompare());
//print out elements of array
System.out.println(Arrays.toString(nameArray));
//count the number of elements in the array
int counter=nameArray.length;
//print out numeric number of elements in array
System.out.println("Number of elements in array: " + counter);
//print out sorted array with shortest first and longest last
printRuleAndArray("Sorted list by name length:");
}