import java.nio.charset.StandardCharsets; public class Main { public static void main(String[] args) { String s = "b"; byte[] bytes = s.getBytes(StandardCharsets.US_ASCII); System.out.println("ASCII Numeric Value: "+bytes[0]); } }