java¶þ½øÖÆ,×Ö½ÚÊý×é,×Ö·û,Ê®Áù½øÖÆ,BCD±àÂëת»»
// ÕûÊýµ½×Ö½ÚÊý×éת»»
public static byte[] int2bytes(int n) {
byte[] ab = new byte[4];
ab[0] = (byte) (0xff & n);
ab[1] = (byte) ((0xff00 & n) >> 8);
ab[2] = (byte) ((0xff0000 & n) >> 16);
ab[3] = (byte) ((0xff000000 & n) >> 24);
return ab;
}
// ×Ö½ÚÊý×éµ½ÕûÊýµÄת»»
public static int bytes2int(byte b[]) {
int s = 0;
s = ((((b[0] & 0xff) << 8 | (b[1] & 0xff)) << 8) | (b[2] & 0xff)) << 8
| (b[3] & 0xff);
return s;
}
// ×Ö½Úת»»µ½×Ö·û
public static char byte2char(byte b) {
return (char) b;
}
private final static byte[] hex = "0123456789ABCDEF".getBytes();
private static int parse(char c) {
if (c >= 'a')
return (c - 'a' + 10) & 0x0f;
if (c >= 'A')
return (c - 'A' + 10) & 0x0f;
return (c - '0') & 0x0f;
}
// ´Ó×Ö½ÚÊý×鵽ʮÁù½øÖÆ×Ö·û´®×ª»»
public static String Bytes2HexString(byte[] b) {
byte[] buff = new byte[2 * b.length];
for (int i = 0; i < b.length; i++) {
buff[2 * i] = hex[(b[i] >> 4) & 0x0f];
buff[2 * i + 1] = hex[b[i] & 0x0f];
}
return new String(buff);
}
// ´ÓÊ®Áù½øÖÆ×Ö·û´®µ½×Ö½ÚÊý×éת»»
public static byte[] HexString2Bytes(String hexstr) {
byte[] b = new byte[hexstr.length() / 2];
int j = 0;
for (int i = 0; i < b.length; i++) {
char c0 = hexstr.charAt(j++);
char c1 = hexstr.charAt(j++);
b[i] = (byte) ((parse(c0) << 4) | parse(c1));
}
return b;
}
Ïà¹ØÎĵµ£º
JavaµÄ×¢ÏúÓï¾äǰҪʹÓÃ×¢ÊÍ·û“//”¡£
ÀàÉùÃ÷¹Ø¼ü×Öclass´´½¨ÁËÒ»¸ö×Ô¶¨ÒåÀࣻÀàµÄÃû×ÖΪWelcome2£¬ÎªJavaÉùÃ÷ÀàÓï¾ä£ºclass Welcome2 {}¡£
·½·¨¹Ø¼ü×ÖmainÉùÃ÷ÁËmain()·½·¨£¬Àý£ºPublic static void main(String args[]) { ......
public class Test4 {
public int binarySearch(int[] items, int value){
int startIndex = 0;
int stopIndex = items.length - 1;
int middle = (int)Math.flo ......
Ö÷Ïß³ÌÖУº
InitThread initThread=new InitThread(new Semaphore(0));//³õʼ»¯Ò»¸ö×ÓỊ̈߳¬´«Ò»¸ö³õֵΪ0µÄÐźÅÁ¿¸øËü
Display.getDefault().asyncExec(initThread);
try {//´Ë´¦»á¹ÒÆð£¬Ö±µ½×ÓÏß³ÌÍê³É¹¤×÷£¬ÐÞ¸ÄÁËÐźÅÁ¿µÄÖµ£¬Ö÷Ï̲߳Żá¼ÌÐø
initThread.getSemaphore().acquire();
} catch (Inte ......
1 ×Ö·û´®±È½ÏÊÇ·ñÏàµÈÓÃʲô·½·¨£¿
2 equals£¨£©ºÍhashCode£¨£©µÄÇø±ð£¿
3 forwardºÍsenRedirectÇø±ð£¿
4 servletÉúÃüÖÜÆÚ£¿
5 ¹ýÂËÆ÷µÄ×÷ÓÃ
6 JSP°üº¬¾²Ì¬ÎļþµÄÓï·¨
7 JSP×¢ÊÍ£¨ÖÁÉÙÁ½¸öÒÔÉÏ£©
8 tableÖÐborder£¬cellpadding,tdÖÐcolspan,rowspanµÄÒâÒå
9 jsÈýÖÖµ¯³ö´°¿Ú a ¾¯¸æ b È·ÈÏ c ÐÅÏ¢ ......
Chapter I.
JavaµÄÓÅȱµã¸÷ÖÖÊéÉ϶¼ÓУ¬ÕâÀïֻ˵˵ÓÃJava×öACM-ICPCµÄÌØµã£º
(1) ×îÃ÷ÏԵĺô¦ÊÇ£¬Ñ§»áJava£¬¿ÉÒԲμÓJava Challenge
(2) ¶ÔÓÚÊìϤC/C++µÄ³ÌÐòÔ±À´Ëµ£¬Java ²¢²»ÄÑѧ£¬ÕÒ±¾Ê飬һÁ½ÖÜÒµÓàʱ¼ä¾Í¿ÉÒԸ㶨ÁË¡£µ±È»£¬ÕâÀïÖ»ÊÇÖ¸Ò»°ã±à³Ì£¬ÏëÊìϤËùÓеÄJava¿â»¹ÊÇÐèҪЩʱ¼äµÄ¡£ÊÂʵÉÏ£¬Java Ö ......