Example usage for java.util Arrays toString

List of usage examples for java.util Arrays toString

Introduction

In this page you can find the example usage for java.util Arrays toString.

Prototype

public static String toString(Object[] a) 

Source Link

Document

Returns a string representation of the contents of the specified array.

Usage

From source file:Main.java

public static void main(String[] args) {
    long[] arr1 = new long[] { 5, 60, 75 };

    System.out.println(Arrays.toString(arr1));

    // copying array arr1 to arr2 with range of index from 2 to 5
    long[] arr2 = Arrays.copyOfRange(arr1, 2, 5);

    System.out.println(Arrays.toString(arr2));
}

From source file:Main.java

public static void main(String[] args) {

    float[] f1 = new float[] { 1.1f, 9.7f, 3.4f };

    System.out.println(Arrays.toString(f1));
}

From source file:Main.java

public static void main(String[] args) {

    char aArr[] = { 'j', 'a', 'v', 'a' };

    System.out.println(Arrays.toString(aArr));

    // sorting array from index 0 to 3
    Arrays.sort(aArr, 0, 3);//from   w w w  . j  ava 2 s. c om

    System.out.println(Arrays.toString(aArr));
}

From source file:Main.java

public static void main(String[] args) {

    int[] arr1 = new int[] { 5, 60, 75 };

    System.out.println(Arrays.toString(arr1));

    // copying array arr1 to arr2 with range from index 2 to 6
    int[] arr2 = Arrays.copyOfRange(arr1, 2, 6);

    System.out.println(Arrays.toString(arr2));
}

From source file:Main.java

public static void main(String[] args) {

    long lArr[] = { 131, 13, 2, 98, 11 };

    System.out.println(Arrays.toString(lArr));

    // sorting array from index 1 to 3
    Arrays.sort(lArr, 1, 3);//from  w  w w .  j ava2s .c  o  m

    System.out.println(Arrays.toString(lArr));
}

From source file:Main.java

public static void main(String[] args) {

    char cArr[] = { 'j', 'a', 'v', 'a' };

    System.out.println(Arrays.toString(cArr));

    // sorting array
    Arrays.sort(cArr);/*w  ww .  j a va2s. c  om*/

    System.out.println(Arrays.toString(cArr));
}

From source file:Main.java

public static void main(String[] args) {

    Color myColor = Color.RED;

    System.out.println(Arrays.toString(myColor.getRGBColorComponents(null)));

}

From source file:Main.java

public static void main(String[] args) {

    Color myColor = Color.RED;

    System.out.println(Arrays.toString(myColor.getColorComponents(null)));

}

From source file:Main.java

public static void main(String[] args) {

    Color myColor = Color.RED;

    System.out.println(Arrays.toString(myColor.getComponents(null)));

}

From source file:Main.java

public static void main(String[] args) {

    Color myColor = Color.RED;

    System.out.println(Arrays.toString(myColor.getRGBComponents(null)));

}