这就是我在伪代码中所需要的:
myArray = {
{Object, Object, Object},
{Object, Object, Object},
{Object, Object, Object},
{Object, Object, Object},
{Object, Object, Object},
}
如何在真正的Java中声明和初始化这样的东西?
答案 0 :(得分:3)
就像这样...
Object[][] myArray = {
{obj11, obj12, obj13},
{obj21, obj22, obj23},
{obj31, obj32, obj33},
{obj41, obj42, obj43},
{obj51, obj52, obj53},
};