Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaºº×Ö×Ö·û´®°´Æ´ÒôÅÅÐò

Ä¿±ê£ºÊµÏÖÒ»¸öºº×Ö×Ö·û´®°´ººÓïÆ´Òô×Öµä˳ÐòÅÅÐò¡£
Ô­Àí£ºÔÚwindows»·¾³µÄgbk×Ö·û¼¯Àºº×ÖÊǰ´ººÓïÆ´Òô×Öµä˳Ðò±àÂëµÄ£¬Èç“´¡”ÊÇB4A1£¬“´¢”ÊÇB4A2¡£ÕâÀïÓиöÎÊÌâ¾ÍÏñÉÏÃæµÄ´¢ºÍ´¡ÕâÑùµÄͬÒô×ÖÖ»ÄÜ×ñÕÕ±àÂëµÄ˳ÐòÁË£¬ÁíÍâ¶àÒô×ÖÒ²µÃ×ñÕÕ±àÂë˳Ðò¡£Éè¼ÆË¼Â·ÊÇÏȲð·Öºº×Ö×Ö·û´®Îª×Ö·ûÊý×飬»ñµÃÿ¸öºº×Ö×Ö·ûµÄ16½øÖÆ×Ö·û´®±íʾ£¬È»ºó±È½Ï¸Ã×Ö·û´®µÄ×Öµä˳Ðò´óС£¬ÅÅÐò¡£ÐèҪ˵Ã÷µÄÊÇ£¬»ñµÃºº×Ö×Ö·ûµÄ×Ö½ÚÊý×飬ת»»³Éint±È½ÏÒ²¿É£¬ÊµÏÖ´ÓÂÔ¡£ÏÂÃæÊÇʵÏֵĴúÂë:
import java.io.UnsupportedEncodingException;
public class HanZiSort {
public static void main(String[] args) throws UnsupportedEncodingException {
String test = "ÎÒ°®±±¾©Ìì°²ÃÅ";
System.out.println(sort(test, "gb2312"));
}
public static String sort(String s, String charset) {
char[] c = s.toCharArray();
for (int i = 0; i < c.length - 1; i++) {
for (int j = i + 1; j < c.length; j++) {
if (getHexString(new String(new char[] { c[i] }), charset)
.compareTo(
getHexString(new String(new char[] { c[j] }),
charset)) > 0) {
char temp = c[i];
c[i] = c[j];
c[j] = temp;
}
}
}
return new String(c);
}
public static String getHexString(String s, String charset) {
byte[] b = null;
StringBuffer sb = new StringBuffer();
try {
b = s.getBytes(charset);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
for (int i = 0; i < b.length; i++) {
sb.append(Integer.toHexString(b[i] & 0xFF));
}
return sb.toString();
}
}
´òÓ¡µÄ½á¹ûΪ£º°®°²±±¾©ÃÅÌìÎÒ


Ïà¹ØÎĵµ£º

javaÈëÃÅ

 Javaѧϰ´ÓÈëÃŵ½¾«Í¨ 
Ò»¡¢ JDK (Java Development Kit) 
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......

Java: class , objects

Java: class , objects
1 Inheritance(¼Ì³Ð)µÄ¹Ø¼ü×Öextends
class MountainBike extends Bicycle {
}
µ«ÊDz»ÄܶàÖØ¼Ì³Ð¡£²»¹ý¿ÉÒÔͨ¹ýimplements¶à¸öinterfaceÀ´ÊµÏÖÀàËÆµÄ¶«Î÷
2 interface
interface Bicycle {
       void changeCadence(int newValue);   // wheel rev ......

java µÄ½Ó¿Úµ½µ×Æðʲô×÷ÓÃ

 ÎÒÏ룬¿ÉÄܲ»Ö¹ÎÒÒ»¸öÈËÓÐÕâ¸öÒÉÎÊ£¬ËùÒÔ£¬°ÑËüÌù³öÀ´¡£
 
¡¡¡¡ÏÂÃæÊÇmadaiºÍclkrst¸øÎҵĻشð¡£
 
¡¡¡¡ÔÚ´ËллÁ½Î»¡£
 
¡¡¡¡ÎÒµÄÎÊÌâÊÇ£º
 
¡¡¡¡java µÄ½Ó¿Úµ½µ×Æðʲô×÷Óã¿
 
¡¡¡¡1¡¢´ÓÊéÖп´µ½µÄÊÇjava³ÌÐòµÄ½Ó¿ÚÖÐÖ»¶¨ÒåÁ˳£Á¿¼°¿Õ·½·¨£¬¿ÕµÄ·½·¨ÓÐʲôÓÃÄØ£¿»¹ÒªÔÚÀàÖÐÐ ......

javaÉú³ÉMD5УÑéÂë¼°Ë㷨ʵÏÖ

 
    ÔÚJavaÖУ¬java.security.MessageDigest £¨rt.jarÖУ©ÒѾ­¶¨ÒåÁË MD5 µÄ¼ÆË㣬ËùÒÔÎÒÃÇÖ»ÐèÒª¼òµ¥µØµ÷Óü´¿ÉµÃµ½ MD5 µÄ128 λÕûÊý¡£È»ºó½«´Ë 128 λ¼Æ 16 ¸ö×Ö½Úת»»³É 16 ½øÖƱíʾ¼´¿É¡£ 
 
    ÏÂÃæÊÇÒ»¸ö¿ÉÉú³É×Ö·û´®»òÎļþMD5УÑéÂëµÄÀý×Ó£¬²âÊÔ¹ý£¬¿Éµ±×ö¹¤¾ß ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ