Program to sort numbers using Selection Sort Method

class linear{
protected int M[] = new int[10];
public void input(int num[])// Entry of array elements
{
for(int i=0;i<10;i++)
M[i]=num[i];
}

public void sort()
{
int x=0,i=0,j=0,n=10,flag=0;
// Display of array
System.out.println("The Array is ");
for(i=0;i {
System.out.print(M[i]);
}
System.out.println();
// Selection Sort
for(int k=0;k {
for(int kk=k+1;kk {
if(M[k]>M[kk])
{
flag = M[k];
M[k]=M[kk];
M[kk]=flag;
}

}
}
System.out.println("The sorted array is ");
for(i=0;i {
System.out.println(M[i]+ " ");
}
}
}