TreeNode[] children = grid[row][col].getChildren();
I would like a simple function that can tell me how many objects are in this array? getChildren()
will return an object of size no larger than 4, for example:
children[0] = null;
children[1] = TreeNode Object
children[2] = null;
children[3] = null;
children.mySizeMethod()
to return 4 or 1 (or something else even)?List
orMap
instead of a plain old array. The Collections API offers so many useful classes and methods.