Java convert ascii to string java example
package com.w3spoint;
public class ASCIIToString {
public static void main(String args[]){
try {
int num[] = {66, 118, 98, 75};
String str =null;
for(int i: num){
str = Character.toString((char)i);
System.out.println(str);
}
} catch (Exception e) {
e.printStackTrace();
}
}
} |
package com.w3spoint; public class ASCIIToString {
public static void main(String args[]){
try {
int num[] = {66, 118, 98, 75};
String str =null;
for(int i: num){
str = Character.toString((char)i);
System.out.println(str);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Output:
Download this example.