double array to Int Array - Java java.lang

Java examples for java.lang:double Array

Description

double array to Int Array

Demo Code


//package com.java2s;

public class Main {
    static public int[] toIntArray(double[] array) {

        int[] r = new int[array.length];
        for (int i = 0; i < r.length; i++) {
            r[i] = (int) array[i];
        }/*from w w  w . j ava2s .co  m*/
        return r;
    }
}

Related Tutorials