Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Could anyone tell me what's wrong with my solution, cause i can't find any mistake with it.

    public static Object[] sortArray(Object names){
    	if(names.getClass().isArray()){
    		int length = Array.getLength(names);
    		Object[] array = new Object[length];       
    		for (int i = 0; i < length; i++) {
    			array[i] = (Array.get(names, i));
    		}
    		if(length > 1){Arrays.sort(array);}
    		return array;			
    	}
    	else{
    		return new Object[]{names};
    	}	
    }
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution