开发者

How to hard define in code a matrix Integer[][]

开发者 https://www.devze.com 2022-12-31 17:10 出处:网络
Question is simple for an expert Integer[][] res= new Integer[][] {.....hard code some values here on 2 dim...}

Question is simple for an expert

Integer[][] res= new Integer[][] {.....hard code some values here on 2 dim...}

How to return here 2 rows and 3开发者_如何学编程 cols like this

1 2 3
4 5 6


int[][] res = {{1,2,3},
               {4,5,6}};


This should work. (But I am no java expert).

Integer [][] ints = { {1, 2, 3}, {4, 5, 6} };
0

精彩评论

暂无评论...
验证码 换一张
取 消