java Unicode与中文互换
static String string2Unicode(String s) {
try {
StringBuffer out = new StringBuffer("");
byte[] bytes = s.getBytes("unicode");
for (int i = 2; i < bytes.length - 1; i += 2) {
out.append("u");
String str = Integer.toHexString(bytes[i + 1] & 0xff);
for (int j = str.length(); j < 2; j++) {
out.append("0");
}
String str1 = Integer.toHexString(bytes[i] & 0xff);
out.append(str);
out.append(str1);
out.append(" ");
}
return out.toString().toUpperCase();
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
}
}
static String unicode2String(String unicodeStr){
StringBuffer sb = new StringBuffer();
String str[] = unicodeStr.toUpperCase().split("U");
for(int i=0;i
相关文档:
import java.awt.*;
import java.awt.event.*;
//俄罗斯方块类
public class ERS_Block extends Frame{
public static boolean isPlay=false;
public static int level=1,score=0;
public static TextField scoreField,levelField;
public static MyTimer timer;
Ga ......
这段时间正在找工作,研究了一下算法。我是做web开发的,但是比较喜欢算法的,所以就总结了一下,觉得仍有很多不足,请大家多多指教。如果有合适的工作也挺推荐推荐的。我做开发已经三年了。我的邮箱:zlljsf@gmail.com
排序算法超类:
/**
* 排序算法超类
* 所有排序序列中元素必须实现java.lang.Comparable接 ......
public class InsertBlobData {
Connection con = null;
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
InsertBlobData data = new InsertBlobData();
data.insertBlogInfo("002jpg", "sdsdfdf", "2007-02-1 ......
Java 反射是Java语言的一个很重要的特征,它使得Java具体了“动态性”。
在Java运行时环境中,对于任意一个类,能否知道这个类有哪些属性和方法?对于任意一个对象,能否调用它的任意一个方法?答案是肯定的。这种动态获取类的信 ......
java的Runtime.getRuntime().exec(commandStr)可以调用执行cmd指令。
cmd /c xx是执行完xx命令后关闭命令窗口。
cmd /k xx是执行完xx命令后不关闭命令窗口。
cmd /c start xx会打开一个新窗口后执行xx指令,原窗口会关闭。
cmd /k start xx会打开一个新窗口后执行xx指令,原窗口不会关闭。
可以用cmd /?查看帮助信息。 ......