fork download
  1. import java.util.*;
  2. public class Main {
  3. public static double[][] integerToDoubleArray(Integer[][] integers) {
  4. double[][] doubles = new double[integers.length][];
  5. for (int i = 0; i < integers.length; i++) {
  6. doubles[i] = new double[integers[i].length];
  7. for (int j = 0; j < integers[i].length; j++) {
  8. doubles[i][j] = integers[i][j];
  9. }
  10. }
  11. return doubles;
  12. }
  13. public static void main(final String[] args){
  14. final Integer[][] arr = {{1,2}, {3,4}};
  15. double[][] ans = integerToDoubleArray(arr);
  16. System.out.println(Arrays.deepToString(arr));
  17. }
  18. }
Success #stdin #stdout 0.06s 32252KB
stdin
Standard input is empty
stdout
[[1, 2], [3, 4]]