String getBytes() Example Program
package com.practice.string;
public class StringGetBytesExPgm {
public static void main(String args[]) {
String s1 = "ABCd";
byte[] b = s1.getBytes();
for (int i = 0; i < b.length; i++) {
System.out.println(b[i]);
}
}
}
Output :
65
66
67
100
public class StringGetBytesExPgm {
public static void main(String args[]) {
String s1 = "ABCd";
byte[] b = s1.getBytes();
for (int i = 0; i < b.length; i++) {
System.out.println(b[i]);
}
}
}
Output :
65
66
67
100
Comments
Post a Comment