DOH!
2011-07-13 14:36:54 UTC
Ok so I have declared a private instance variable capable of referencing a two-dimensional array of type boolean (note, not Boolean).
which is:
private boolean matrix[][];
Then Im doing a program which uses private class constants which have int values.
So for example:
private final int CONSTANT_VALUE_ONE = 5;
private final int CONSTANT_VALUE_TWO = 6;
private final int CONSTANT_VALUE_THREE = 10;
So then I created a two dimensional array of boolean that has CONSTANT_VALUE_ONE rows and (CONSTANT_VALUE_TWO times CONSTANT_VALUE_THREE) columns and assign it to the instance variable matrix.
which is:
boolean[][] matrix = new boolean [ CONSTANT_VALUE_ONE] [ CONSTANT_VALUE_TWO * CONSTANT_VALUE_THREE];
Not this is where I get stuck, I want to be able to have a method which prints a textual representation of matrix printing a '.' (or period) character for elements in the array with the value false and a 'O' (uppercase letter 'O') for elements in the array with the value true.
I know that this can be done with for loops for foreach loops and such, but I cant put pen to paper as they say!
Thank you for any help given.