convert integer array to string array
int[] nums = {5,1,2,11,3}; //List or Vector
Arrays.sort(nums); //Collections.sort() for List,Vector
String a=Arrays.toString(nums); //toString the List or Vector
String ar[]=a.substring(1,a.length()-1).split(", ");
System.out.println(Arrays.toString(ar));int[] array = { 1, 2, 3, 4, 5 };
String s = String.join("", IntStream.of(array).mapToObj(String::valueOf).toArray(String[]::new));
System.out.println(s); // 12345
Also in Java:
- java script removing first three indexes
- java pause program until key pressed
- java list get first element
- java obtain list string from list object
- java string replace character at position
- creating thread in java example
- how to make a variable unchangeable in java
- java stream remove
- java while loop example
- create instance object java
- java variables in annotations
- how to make a list java
- check if a char is a space java
- how make a final variable in java
- jstl core tags
- java define main function
- how to check if rs next is null
- new hashmap java
- java initialize array in one line
- java ternary operator
- java do while
- multiplication program java
- bracket balancing program in java
- how to separate no and text in java