Compare Two float Arrays - Java Language Basics

Java examples for Language Basics:float

Description

Compare Two float Arrays

Demo Code

 
import java.util.Arrays;
 
public class Main {
 
  public static void main(String[] args) {
    float[] floatArray1 = new float[]{9.4f,3.4f,5.1f};
    float[] floatArray2 = new float[]{9.4f,3.4f,5.1f};
   //w  w  w  . j a v a 2  s.  c o  m
    boolean blnResult = Arrays.equals(floatArray1,floatArray2);
    System.out.println("Are two float arrays equal ? : " + blnResult);
   
  }
}

Result


Related Tutorials