JavaÖÐhashCode()·½·¨µÄ˵Ã÷
ÓÐÐí¶àÈËѧÁ˺ܳ¤Ê±¼äµÄJava£¬µ«Ò»Ö±²»Ã÷°×hashCode·½·¨µÄ×÷Óã¬
ÎÒÀ´½âÊÍһϰɡ£Ê×ÏÈ£¬ÏëÒªÃ÷°×hashCodeµÄ×÷Óã¬Äã±ØÐëÒªÏÈÖªµÀJavaÖеļ¯ºÏ¡£¡¡¡¡
×ܵÄÀ´Ëµ£¬JavaÖеļ¯ºÏ£¨Collection£©ÓÐÁ½À࣬һÀàÊÇList£¬ÔÙÓÐÒ»ÀàÊÇSet¡£
ÄãÖªµÀËüÃǵÄÇø±ðÂð£¿Ç°Õß¼¯ºÏÄÚµÄÔªËØÊÇÓÐÐòµÄ£¬ÔªËØ¿ÉÒÔÖظ´£»ºóÕßÔªËØÎÞÐò£¬µ«ÔªËز»¿ÉÖظ´¡£
ÄÇôÕâÀï¾ÍÓÐÒ»¸ö±È½ÏÑÏÖصÄÎÊÌâÁË£ºÒªÏë±£Ö¤ÔªËز»Öظ´£¬¿ÉÁ½¸öÔªËØÊÇ·ñÖظ´Ó¦¸ÃÒÀ¾ÝʲôÀ´ÅжÏÄØ£¿
Õâ¾ÍÊÇObject.equals·½·¨ÁË¡£µ«ÊÇ£¬Èç¹ûÿÔö¼ÓÒ»¸öÔªËؾͼì²éÒ»´Î£¬ÄÇôµ±ÔªËغܶàʱ£¬ºóÌí¼Óµ½¼¯ºÏÖеÄÔªËرȽϵĴÎÊý¾Í·Ç³£¶àÁË¡£
Ò²¾ÍÊÇ˵£¬Èç¹û¼¯ºÏÖÐÏÖÔÚÒѾÓÐ1000¸öÔªËØ£¬ÄÇôµÚ1001¸öÔªËؼÓÈ뼯ºÏʱ£¬Ëü¾ÍÒªµ÷ÓÃ1000´Îequals·½·¨¡£ÕâÏÔÈ»»á´ó´ó½µµÍЧÂÊ¡£
ÓÚÊÇ£¬Java²ÉÓÃÁ˹þÏ£±íµÄÔÀí¡£¹þÏ££¨Hash£©Êµ¼ÊÉÏÊǸöÈËÃû£¬ÓÉÓÚËûÌá³öÒ»¹þÏ£Ëã·¨µÄ¸ÅÄËùÒÔ¾ÍÒÔËûµÄÃû×ÖÃüÃûÁË¡£
¹þÏ£Ëã·¨Ò²³ÆΪɢÁÐËã·¨£¬Êǽ«Êý¾ÝÒÀÌض¨Ëã·¨Ö±½ÓÖ¸¶¨µ½Ò»¸öµØÖ·ÉÏ¡£Èç¹ûÏêϸ½²½â¹þÏ£Ëã·¨£¬ÄÇÐèÒª¸ü¶àµÄÎÄÕÂƪ·ù£¬ÎÒÔÚÕâÀï¾Í²»½éÉÜÁË¡£
³õѧÕß¿ÉÒÔÕâÑùÀí½â£¬hashCode·½·¨Êµ¼ÊÉÏ·µ»ØµÄ¾ÍÊǶÔÏó´æ´¢µÄÎïÀíµØÖ·£¨Êµ¼Ê¿ÉÄܲ¢²»ÊÇ£©¡£
ÕâÑùÒ»À´£¬µ±¼¯ºÏÒªÌí¼ÓеÄÔªËØʱ£¬Ïȵ÷ÓÃÕâ¸öÔªËصÄhashCode·½·¨£¬¾ÍÒ»ÏÂ×ÓÄܶ¨Î»µ½ËüÓ¦¸Ã·ÅÖõÄÎïÀíλÖÃÉÏ¡£
Èç¹ûÕâ¸öλÖÃÉÏûÓÐÔªËØ£¬Ëü¾Í¿ÉÒÔÖ±½Ó´æ´¢ÔÚÕâ¸öλÖÃÉÏ£¬²»ÓÃÔÙ½øÐÐÈκαȽÏÁË£»Èç¹ûÕâ¸öλÖÃÉÏÒѾÓÐÔªËØÁË£¬
¾Íµ÷ÓÃËüµÄequals·½·¨ÓëÐÂÔªËؽøÐбȽϣ¬ÏàͬµÄ»°¾Í²»´æÁË£¬²»Ïàͬ¾ÍÉ¢ÁÐÆäËüµÄµØÖ·¡£
ËùÒÔÕâÀï´æÔÚÒ»¸ö³åÍ»½â¾öµÄÎÊÌâ¡£ÕâÑùÒ»À´Êµ¼Êµ÷ÓÃequals·½·¨µÄ´ÎÊý¾Í´ó´ó½µµÍÁË£¬¼¸ºõÖ»ÐèÒªÒ»Á½´Î¡£
ËùÒÔ£¬Java¶ÔÓÚeqauls·½·¨ºÍhashCode·½·¨ÊÇÕâÑù¹æ¶¨µÄ£º
1¡¢Èç¹ûÁ½¸ö¶ÔÏóÏàͬ£¬ÄÇôËüÃǵÄhashCodeÖµÒ»¶¨ÒªÏàͬ£»2¡¢Èç¹ûÁ½¸ö¶ÔÏóµÄhashCodeÏàͬ£¬ËüÃDz¢²»Ò»¶¨Ïàͬ ÉÏÃæ˵µÄ¶ÔÏóÏàָͬµÄÊÇÓÃeqauls·½·¨±È½Ï¡£
Ä㵱Ȼ¿ÉÒÔ²»°´ÒªÇóÈ¥×öÁË£¬µ«Äã»á·¢ÏÖ£¬ÏàͬµÄ¶ÔÏó¿ÉÒÔ³öÏÖÔÚSet¼¯ºÏÖС£Í¬Ê±£¬Ôö¼ÓÐÂÔªËصÄЧÂÊ»á´ó´óϽµ¡£
Ïà¹ØÎĵµ£º
public static boolean isCheckN(String pInput) {
String regEx = "^[0-9]+$";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(pInput);
......
Ctrl+1 ¿ìËÙÐÞ¸´(×î¾µäµÄ¿ì½Ý¼ü,¾Í²»Óöà˵ÁË)
Ctrl+D: ɾ³ýµ±Ç°ÐÐ
Ctrl+Alt+↓ ¸´ÖƵ±Ç°Ðе½ÏÂÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Ctrl+Alt+↑ ¸´ÖƵ±Ç°Ðе½ÉÏÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Alt+↓ µ±Ç°ÐкÍÏÂÃæÒ»Ðн»»¥Î»ÖÃ(ÌرðʵÓÃ,¿ÉÒÔÊ¡È¥ÏȼôÇÐ,ÔÙÕ³ÌùÁË)
Alt+↑ µ±Ç°ÐкÍÉÏÃæÒ»Ðн»»¥Î»ÖÃ(ͬÉÏ)
Alt+← Ç°Ò»¸ö±à¼µÄÒ³Ãæ ......
Java
ÃüÁîÐй¤¾ß×ܽá
1¡¢ÃüÁî
C\Documents and Settings\Zianed>ls ‘%JAVA_HOME%’/bin
HtmlConverter.exe javap.exe jstatd.exe rmid.exe
appletviewer.exe javaw.exe &n ......
ÎÄÖÐjstat²¿·Öת×Ô
http://blog.csdn.net/kozazyh/archive/2010/02/04/5289684.aspx
ÓÃjavaÓïÑÔ±à³ÌµÄʱºò£¬sunÌṩÁ˼¸¸öС¹¤¾ß£¬ÓÃ×Å»¹ÊDz»´íµÄ£¬ÌØÒâ×öÏÂ×ܽá
1.jps
jpsÓÃÀ´²é¿´µ±Ç°javaµÄ½ø³Ì£¬ÆäʵËüµÄ¹¦ÄÜ¿ÉÒÔ»ù±¾ÉÏÓÉpsÀ´ÊµÏÖ
¼¸¸ö³£ÓõIJÎÊý£º
-q Ö»ÏÔʾpid£¬²»ÏÔʾclassÃû³Æ,jarÎļþÃûºÍ´«µÝ¸ømain ·½·¨µÄ²Î ......
http://lavasoft.blog.51cto.com/62575/27069
ÊØ»¤Ï̺߳ÍÓû§Ïß³Ì
ÊØ»¤Ïß³ÌÓëÆÕͨÏ̵߳ÄΨһÇø±ðÊÇ£ºµ±JVMÖÐËùÓеÄÏ̶߳¼ÊÇÊØ»¤Ï̵߳Äʱºò£¬JVM¾Í¿ÉÒÔÍ˳öÁË£»Èç¹û»¹ÓÐÒ»¸ö»òÒÔÉϵķÇÊØ»¤Ïß³ÌÔò²»»áÍ˳ö¡££¨ÒÔÉÏÊÇÕë¶ÔÕý³£Í˳ö£¬µ÷ÓÃSystem.exitÔò±Ø¶¨»áÍ˳ö£©
ËùÒÔsetDeamon(true)µÄΨһÒâÒå¾ÍÊǸæËßJVM²»ÐèÒªµÈ´ ......