package com.myapp.test;
import java.util.Arrays;
public class ArrayListFeature {
public static void main(String[] args) {
int[] anArray = { 1, 3, 5, 7, 9, 11, 13, 15, 16, 20 };
System.out.println(Arrays.toString(anArray));
// deepToString for multi dim array
double[][] apartment1 = { { 4.6, 8.5, 3.2, 5.1 },
{ 6.4, 11.1, 4.1, 6.2 } };
double[][] apartment2 = { { 4.6, 8.5, 3.2, 5.1 },
{ 6.4, 11.1, 4.1, 6.2 } };
System.out.println(Arrays.toString(apartment1));
System.out.println(Arrays.deepToString(apartment1));
// Arrays.deepEquals(array1,array1)
System.out.println(Arrays.deepEquals(apartment1, apartment2));
System.out.println(Arrays.equals(apartment1, apartment2));
System.out.println(Arrays.hashCode(apartment1));
System.out.println(Arrays.deepHashCode(apartment1));
}
}
import java.util.Arrays;
public class ArrayListFeature {
public static void main(String[] args) {
int[] anArray = { 1, 3, 5, 7, 9, 11, 13, 15, 16, 20 };
System.out.println(Arrays.toString(anArray));
// deepToString for multi dim array
double[][] apartment1 = { { 4.6, 8.5, 3.2, 5.1 },
{ 6.4, 11.1, 4.1, 6.2 } };
double[][] apartment2 = { { 4.6, 8.5, 3.2, 5.1 },
{ 6.4, 11.1, 4.1, 6.2 } };
System.out.println(Arrays.toString(apartment1));
System.out.println(Arrays.deepToString(apartment1));
// Arrays.deepEquals(array1,array1)
System.out.println(Arrays.deepEquals(apartment1, apartment2));
System.out.println(Arrays.equals(apartment1, apartment2));
System.out.println(Arrays.hashCode(apartment1));
System.out.println(Arrays.deepHashCode(apartment1));
}
}