Compare two float type arrays in Java
Description
The following code shows how to compare two float type arrays.
Example
//from w ww .ja v a 2 s. c o m
import java.util.Arrays;
public class Main {
public static void main(String[] argv) throws Exception {
boolean b = Arrays.equals(new float[] { 0F }, new float[] { 0F }); // true
System.out.println(b);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »