public class Makakiesmarkou {
void swap(int i, int j, int[] arr) {
int t = arr[i];
arr[i] = arr[j];
arr[j] = t;
}
public void MySort(int[] T)
{
for(int m=0; m<T.length-1; m++)
{
int j=m;
for(int k=m+1; m<T.length-1; k++)
{
if(T[k]<T[j])
j=k;
}
swap(T[j], T[m], T);
}
}
public static void main(String[] args) {
int[] pin= new int[50];
MySort(pin);
System.out.println(Arrays.toString(pin));
}
}
the error when i call MySort in the main class is "non static method MySort[int[]] cannot be referenced from a static context"
what am i doing wrong?