2011-12-08 149 views
0

嗨的矩阵我要创建具有一定dimension.is对象的矩阵是矩阵的possible.the尺寸为INT,而内容是我object.How可以做什么?创建对象

回答

2

你需要像

myobjectMatrix foo[][] = new myobjectMatrix[width][height] 

// Remember that everything in the matrix is initialized to null so 
// you must initialize everything 
foo[0][0] = new myobjectMatrix(); 
3

一点搜索不伤害。这很简单。

Object[][] matrix = new Object[rows][cols];