Now arr1 [ ] is smaller Sort the first array and print its elements ( these two steps can be swapped as order in output is not important )
Arrays . sort ( arr1 ) ; for ( int i = 0 ; i < m ; i ++ ) System . out . print ( arr1 [ i ] + " ▁ " ) ;