Compare Two double Arrays - Java Language Basics

Java examples for Language Basics:double

Description

Compare Two double Arrays

Demo Code


 
import java.util.Arrays;
 
public class Main {
 
  public static void main(String[] args) {

    double[] dblArray1 = new double[]{10.3,7.13,41.2};
    double[] dblArray2 = new double[]{10.3,7.13,41.2};
   /*from  www . j  a v a2  s.c  om*/
    boolean blnResult = Arrays.equals(dblArray1,dblArray2);
    System.out.println("Are two double arrays equal ? : " + blnResult);
   
  }
}

Result


Related Tutorials