2011-12-08 141 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];