Q:

Java program to convert an integer array into the string using the \'+\' operator

belongs to collection: Java Conversion Programs

0

Java program to convert an integer array into the string using the '+' operator

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program/Source Code:

The source code to convert an integer array into the string using the "+" operator is given below. The given program is compiled and executed successfully.

// Java program to convert an integer array into 
// the string using the "+" operator

import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    int i;
    String str = "";
    int[] arr = {53, 7, 64, 1, 9};

    for (i = 0; i < arr.length; i++) {
      str += arr[i];
    }

    System.out.println(str);
  }
}

Output:

5376419

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

<< Java program to convert a short integer into a str...