日期:2014-05-17 浏览次数:20706 次
import java.util.Arrays;
public class GetByteDemo {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String s ="hdu";
char[] charArray=s.toCharArray();
byte[] byteArray=s.getBytes();
System.out.println(Arrays.toString(byteArray));
}
}
<%@page import="java.util.Arrays"%>
<%@ page contentType="text/html;charset=gb2312"%>
<%@ import="java.util.*" %>
<html>
<body>
<br>
<%
String s ="hdu";
char[] charArray=s.toCharArray();
byte[] byteArray=s.getBytes();
out.println(Arrays.toString(getBytes));
%>
</body>
</html>