Java Print Contents Of Int Array Code Example

Snippet 1
  import java.util.Arrays;

class Scratch{
    public static void main(String[] args){
        int[] arr = new int[3];
        System.out.println( Arrays.toString( arr ));
      	//prints [0, 0, 0]
    }
} 
Snippet 2
  int[] intArray = new int[] {1, 2, 3, 4, 5};
System.out.println(intArray);     // prints something like '[[email protected]' 

Similar Snippets


Create Copy Of Array From Another Array Code Example - java

Creating Java Main Method Code Example - java

Find Duplicates In Arraylist Java Code Example - java

Java Creat A Folder Code Example - java

Firestore Find Doc And Set Data Code Example - java