Why, I have to ask, are you using parseInt anyway?
public static String checkDigits(int cardNo)
{
String a = new String ();
a = cardNo + " ";
char [ ] array = a.toCharArray ( );
int [ ] array2 = new int [7];
for ( int i = 0; i < array.length; i++)
{
array2 [i] = Integer.parseInt (a);
}
cardNo is an int.
array2 is an array of ints.
a is a string that contains the input number and a space...so all you are doing is trying to parse a number that you already have as an int to an int, and failing because you added a space onto it in the first place!
I'm assuming that what you are trying to do is get each digit of the input integer into a separate int? If so, then work from the least significant digit, and use the modulus operator '%' to extract each digit one at a time, then divide by ten. You don't need to faff about with strings and characters at all, and you definitely don't need to parse anything!