what is the error in the swap function?
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int i;
int a[]=new int[n];
for(i=0;i<n;i++)
{
a[i]=sc.nextInt();
}
int low=0,mid=0,high=n-1;
public static int(int l,int m)
{
int temp;
temp=m;
m=l;
l=temp;
return;
}
while(mid<=high)
{
switch(a[mid])
{
case 0 : swap(a[low],a[mid]);
low++;
mid++;
case 1:
mid++;
break;
case 2:
swap(a[mid],a[high]);
high--;
break;
}
}
}
}