Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

cannot invoke toString on the primitive type int

800640Nov 17 2009 — edited Nov 17 2009
im trying to make a sudoku puzzle but having trouble with the arrays, ive got two arrays
int [][] actual = new int [9][9];
    String [][] possible = new String [9][9];
part of my code im trying to generate a sudoku board, this is the part of the error in
public void possVals(int col, int row)
	{
		if(possible[col][row].equals(""))
		{
			str = "123456789";
		}
		else str = possible[col][row];
		
		for(r = 1; r < 9; r++)
		{
			if(actual[col][r] != 0)
			{
				str = str.Replace(actual[col][r].toString(), "");
			}
		}
could some one tell me how to fix my error of 'cannot invoke toString on the primitive type int' please
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 15 2009
Added on Nov 17 2009
8 comments
4,678 views