java help | Sololearn: Learn to code for FREE!
+ 1

java help

public class Main { public static int[][] createMatrix(int x,int y){ int [][] data = new int [x][y]; return data; } public static void main(String[] args) { System.out.println(createMatrix(5,7)); Help me to change the code that to create matrix 5x7;3x1;4x9

14th Jan 2019, 4:14 AM
Kasia Herasymenko
Kasia Herasymenko - avatar
1 Answer
0
System.out.println (createMatrix (3,1)); You only have to change x and y when you call this method. But I'm not sure if you have to fill your matrix.
14th Jan 2019, 9:38 AM
Denise Roßberg
Denise Roßberg - avatar