JAVAÕýÔòÖÐÎÄÆ¥Åä
1¡¢Æ¥ÅäË«ÒýºÅ¼äÄÚÈÝ£º
Java´úÂë
public
void
test1() {
// Æ¥ÅäË«ÒýºÅ¼äÄÚÈÝ
String pstr = "\"([^\"]+)\""
;
Pattern p = Pattern.compile(pstr);
Matcher m = p.matcher("\"goodjob\""
);
System.out.println(m.find() ? m.group(1
) :
"nothing"
);
// ²âÊÔÖÐÎÄ
m = p.matcher("\"goodjobÀïÃæÓÐÖÐÎÄÄØ\""
);
System.out.println(m.find() ? m.group(1
) :
"nothing"
);
}
public void test1() {
// Æ¥ÅäË«ÒýºÅ¼äÄÚÈÝ
String pstr = "\"([^\"]+)\"";
Pattern p = Pattern.compile(pstr);
Matcher m = p.matcher("\"goodjob\"");
System.out.println(m.find() ? m.group(1) : "nothing");
// ²âÊÔÖÐÎÄ
m = p.matcher("\"goodjobÀïÃæÓÐÖÐÎÄÄØ\"");
System.out.println(m.find() ? m.group(1) : "nothing");
}
2¡¢ÖÐÎÄÄÚÈÝҲƥÅ䣺
Java´úÂë
public
void
test2() {
// ÖÐÎÄÄÚÈÝҲƥÅä
String pstr = "\"([^\"|[\u4e00-\u9fa5]]+)\""
;
Pattern p = Pattern.compile(pstr);
Matcher m = p.matcher("\"goodjobÀïÃæÓÐÖÐÎÄÄØ\""
);
System.out.println(m.find() ? m.group(1
) :
"nothing"
); &n
Ïà¹ØÎĵµ£º
Ò»¡¢Annotation¾¿¾¹ÊÇʲô£¿
Annotation ÌṩÁËÒ»ÌõÓë³ÌÐòÔªËØ¹ØÁªÈκÎÐÅÏ¢»òÕßÈκÎÔªÊý¾Ý£¨metadata£©µÄ;¾¶¡£´ÓijЩ·½Ãæ¿´£¬annotation¾ÍÏñÐÞÊηûÒ»Ñù±»Ê¹Ó㬲¢Ó¦ÓÃÓÚ°ü¡¢ÀàÐÍ¡¢¹¹Ôì·½·¨¡¢·½·¨¡¢³ÉÔ±±äÁ¿¡¢²ÎÊý¡¢±¾µØ±äÁ¿µÄÉùÃ÷ÖС£ÕâЩÐÅÏ¢±»´æ´¢ÔÚannotationµÄ“name=value”½á¹¹¶ÔÖÐ ......
ѧϰÁËÁ½ÆªµÄRuntimeÀ࣬ÏÖÔÚ¶ÔËüÓÐÁ˸üÉîÒ»²ãµÄÁ˽⣬ÄÇôÎÒÃÇÀ´¿´¿´ÏÂÃæµÄ´úÂ룺
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader ;
import java.io.BufferedReader;
public class Exec_Output{
public static void main(String []args)throws IOException,Int ......
JAVAÏà¹Ø»ù´¡ÖªÊ¶
1¡¢ÃæÏò¶ÔÏóµÄÌØÕ÷ÓÐÄÄЩ·½Ãæ
1.³éÏó£º
³éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£
2.¼Ì³Ð£º
¼Ì³ÐÊÇÒ»ÖÖÁª½áÀàµÄ²ã´ÎÄ£ÐÍ£¬²¢ ......
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
/**
* JavaÈçºÎÿ5ÃëÉú³ÉÒ»¸öËæ»úÊý
*
* @author JavaÈË(java2000.net)
*/&nbs ......
/************************************************
MD5 Ëã·¨µÄJava Bean
*************************************************/
package beartool;
import java.lang.reflect.*;
public class MD5 {
/* ÏÂÃæÕâЩS11-S44ʵ¼ÊÉÏÊÇÒ»¸ö4*4µÄ¾ ......