Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

arrays.tostring java

import java.io.*;
import java.util.*;
  
class GFG {
    public static void main(String[] args)
    {
        // Let us create different types of arrays and
        // print their contents using Arrays.toString()
        boolean[] boolArr = new boolean[] { true, true, false, true };
        byte[] byteArr = new byte[] { 10, 20, 30 };
        char[] charArr = new char[] { 'g', 'e', 'e', 'k', 's' };
        double[] dblArr = new double[] { 1, 2, 3, 4 };
        float[] floatArr = new float[] { 1, 2, 3, 4 };
        int[] intArr = new int[] { 1, 2, 3, 4 };
        long[] lomgArr = new long[] { 1, 2, 3, 4 };
        Object[] objArr = new Object[] { 1, 2, 3, 4 };
        short[] shortArr = new short[] { 1, 2, 3, 4 };
  
        System.out.println(Arrays.toString(boolArr));
        System.out.println(Arrays.toString(byteArr));
        System.out.println(Arrays.toString(charArr));
        System.out.println(Arrays.toString(dblArr));
        System.out.println(Arrays.toString(floatArr));
        System.out.println(Arrays.toString(intArr));
        System.out.println(Arrays.toString(lomgArr));
        System.out.println(Arrays.toString(objArr));
        System.out.println(Arrays.toString(shortArr));
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java printf trailing whitespace 
Java :: how to initialize a set in java 
Java :: java stream distinct by object atribute 
Java :: how to iterate pixels image java 
Java :: function in java 
Java :: how to resize image in java swing 
Java :: print float number with only four places after the decimal point in java 
Java :: iterable interface in java 
Java :: convert arraylist to csv file java 
Java :: check palindrome in java 
Java :: how to print to the console in java 
Java :: running sum of 1d array java 
Java :: How to initialize a 2d array in Java? 
Java :: java create new arraylist with elements 
Java :: next greater permutation leetcode 
Java :: how to initialize array in java 
Java :: java replaceAll ignore case 
Java :: how to change theme of app in android studio programmatically 
Java :: tic tac toe in java 
Java :: timestamp with zone java 
Java :: List into string java 
Java :: intellij 
Java :: java enum length 
Java :: list of integers in java 
Java :: android sqlite select query 
Java :: replace character in string java 
Java :: java swing dialog box 
Java :: reverse in jaav 
Java :: how to reverse a string in java without function 
Java :: how to find prime numbers in java 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =