sto facendo una Swing ed ho un problema con i tipi di dato ora vi scrivo la riga di codice che mi da problemi

Integer a =(Integer)(table.getValueAt(i,j));
res[i][j]=a.intValue();


dove
table è una Jtable
res è un int[][]
table.getValueAT(i,j) restituisce un Object secondo le api

mi da un errore che java.lang.String nn puo' essere castato ad Integer perchè da questo errore se il metodo restituisce un Object??