it sounds crazy I know. I'm newbie at programming and having trouble with somethings. Lately, I've been doing some arrays and I know how to check equals two other arrays like using Arrays.equals(object, object) but what I mean is I am working on 1 array. I want to check equals if the array is after sorted and before sorted.
System.out.println("your array before sorted: " + Arrays.toString(size));
//System.out.println("total of the elements: " +sum);
Arrays.sort(size);
System.out.println("your array after sorted: "+ Arrays.toString(size));
if(Arrays.equals(size, size)) {
System.out.println("true af ");
}
I tried to create a variable which stores the sorted array but it gives my an error cannot convert from void to int or something" because Arrays.sort(object) function returns void
.
Any help would be appreciated.