Sorting random non-repeating numbers
I tested it and it works as it should. I would only like to remark a couple of things. 

You may want to split your long commented function into shorter ones:


static int[] InitArray(int length){...}
static int[] SelectionSort(int[]arr){...}
static void Swap(int[]arr, int i, int j){...}
print the result in the main(), as you do know.


This makes your code easier to read and easier to reuse.

Another thing I'd remove is the if(max != i). I'd rather make the swap every time.  If you look carefully, there's small chance that you do this operation unnecessarily, and when you do do it, it won't harm you. 

Note: If you keep doing the swap as you do now, you won't have any problem by removing the if. However, if you modify it to make the swap without a temp variable, it might go wrong.