I made this function to sort an array. I have to used in a threading example. 

```
public int[] Arrsort()
{
    int[] array = new int[100];
    Random rand = new Random(12345);

     for (int i = 0; i <100; i++)
     {
        array[i] = rand.Next(100);
     }
    Array.Sort(array);
    return array;
}

```

The problem with the function is that it wasn't working with Thread class object. As in when when I was passing it as follows-->

```
for (int i = 0; i < 5; i++)
{
    Thread newThread = new Thread(p.Arrsort);
    newThread.Start();
    int[] arrsort1 = p.Arrsort();
    // for (int n=0; n<arrsort.Length; n++)
    Console.WriteLine(arrsort1[n]); //printing the elements
}

```

The code was generating this error...

> 
> Error CS0407 'int[] Program.Arrsort()' has the wrong return type 
> 
> 
> 

Therefore, I was compelled to make another function 

```
public void Thrsort() { Arrsort(); } 
//void method created so Arrsort() can be called in thread
//the Thread class is not taking int[] types directly (please see)   

```

I passed Thrsort () into the thread object. Then only my code was being compiled.

Is there any other way to solve the problem so that I have not to create another function i.e. thrsort()? Please suggest edits in code of function arrsort ()..