How do I write a method with a void return value that inverts all the elements of a two-dimensional array of booleans (true becomes false and false becomes true) that includes code to test your method. The output should show all the values of the array prior to inverting them and afterwards.
Now I have the code complete but when I go to use System.out.println to display the array, I'm getting some strange values popping up in the answer. Can anybody help me out. Here is the code:
public class TF
{
public static void main(String[] args)
{
boolean [][] bArray = {{false,false,true},{true,false,true}};
System.out.println("This is before: " + bArray);
for(int i = 0; i > bArray.length; i++)
{
for(int j = 0; j < bArray[i].length; i++)
{
bArray[i][j] = !(bArray[i][j]);
}//endfor(j)
}//endfor(i)
System.out.println("This is after: " + bArray);
}//endmain
}//end TF
And this is the returntype I'm getting:
This is before: [[Z@69ed56e2
This is after: [[Z@69ed56e2
Anyone have any idea why I'm getting this?