/* This is a question for an online test where the student writes a function whose answer is validated by my 'correctfunction' which is hidden to the student. I want to compare the results of the two functions in main method. */
import java.util.Arrays;
    class SortArr
  {
   static int[] arr = new int[10];
 public int[] sortin(int[] ans)
 {
      Arrays.sort(ans);
      System.out.println(Arrays.toString(ans));
      return ans;
    }
  public int[] correctfunction(int[] sol)
  {
      Arrays.sort(sol);    
      System.out.println(Arrays.toString(sol)); 
       return sol;
    }
  public static void main(String[] args)
  {   
      arr = new int[] {4,8,3,15,2,21,6,19,11,7};
      SortArr ob=new SortArr();
      ob.correctfunction(arr);
      ob.sortin(arr); 
      if(Arrays.equals(ob.sol == ob.ans))  //non-static method //equals(Object) cannot be referenced from a static context
//variable ob of type SortArr: cannot find symbol
      System.out.println("correct");
      else
      System.out.println("incorrect");
  }
 }