编译并执行Java Online


编译并执行Java Online

import javax.xml.bind.DatatypeConverter;



public class ByteToHexString {

   public static void main(String args[]) {

      String sam = "Hello how are you how do you do";

      byte[] byteArray = sam.getBytes();

      String hex = DatatypeConverter.printHexBinary(byteArray);

      System.out.println(hex);

   }

}