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[]) {
    boolean[] array = new boolean[] { true, true, true };

    Array.setBoolean(array, 1, false);

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

}

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(5);
    cb1.append("java2s.com", 0, 4);
    cb1.rewind();//from  w w w  .  ja v a 2 s  .  c om

    System.out.println(Arrays.toString(cb1.array()));

}

From source file:Main.java

public static void main(String[] args) {
    LocalDate[] a = previousWeekDay(LocalDate.now());

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

From source file:Main.java

public static void main(String[] args) {
    int[] origNum = { 1, 2, 3 };
    String[] origNames = { "Java", "SQL" };
    System.out.println("Before method  call, origNum:" + Arrays.toString(origNum));
    System.out.println("Before method  call, origNames:" + Arrays.toString(origNames));

    // Call methods passing the arrays 
    tryElementChange(origNum);// w  ww. ja v  a  2  s . c o  m
    tryElementChange(origNames);

    System.out.println("After method  call, origNum:" + Arrays.toString(origNum));
    System.out.println("After method  call, origNames:" + Arrays.toString(origNames));
}

From source file:Main.java

public static void main(String[] argv) {
    Function<Integer, int[]> arrayCreator3 = int[]::new;
    int[] intArray = arrayCreator3.apply(5);
    System.out.println(Arrays.toString(intArray));
}

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer bb = ShortBuffer.wrap(new short[] { 0, 1, 2, 3, 4, 5, 6 }, 0, 3);
    bb.put((short) 100);
    System.out.println(Arrays.toString(bb.array()));

}

From source file:Main.java

public static void main(String args[]) {

    String[] myArray = new String[] { "A", "B", "b" };
    Arrays.sort(myArray, Collator.getInstance());

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

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(50);
    cb1.append("java2s.com");
    cb1.rewind();//from  w w w.j  av  a 2s.c o m

    System.out.println(Arrays.toString(cb1.array()));

    CharBuffer cb2 = cb1.slice();
    System.out.println(cb2.equals(cb1));

}

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(50);
    cb1.append("java2s.com");
    cb1.rewind();/*  w w w .j a  v  a 2s .  co  m*/

    System.out.println(Arrays.toString(cb1.array()));

    CharBuffer cb2 = cb1.slice();
    System.out.println(cb2.compareTo(cb1));

}

From source file:Main.java

public static void main(String[] args) {
    List<String> stringList = Arrays.asList("2", "1", "3", "4");

    Object[] n = stringList.stream().toArray();
    System.out.println(Arrays.toString(n));
}