Form Biggest Number - Comparator not working

Can anyone help me out why this comparator is not working
class sortClass implements Comparator
{
public int compare(Integer a, Integer b)
{
int ab = attachNumber(a,b);
int ba = attachNumber(b,a);
if(ab>ba)
{
return -1;
}
else
{
return 1;
}
}

public int attachNumber(int a, int b)
{
	int tens = 1;
	while(b>tens)
	{
		tens=tens*10;
	}
	a=a*tens+b;
	return a;
}

}

@nannu make your attachnumber function static.
also your code is giving wrong answer for all test cases
try input
1
8
1 34 3 98 9 76 45 4
you are getting
199876454343
answer should be
998764543431