ËĸöÓꦵÄjava±à³ÌÏ°¹ß
John O'Hanley µÄÕâƪÎÄÕÂÁоÙÁËËĸöÓꦵÄjava±àÂëÏ°¹ß£¬²¢Ìá³öÁ˸ÄÕý·½°¸¡£
ÕâËĸöÏ°¹ßÆÕ±é´æÔÚÓÚjava³ÌÐòÔ±ÖУ¬²¢ÇÒÒѾ±»¹ã·º½ÓÊÜ£¬´ó¼Ò¶¼Ï°ÒÔΪ³££¬Á÷¶¾ÉõÔ¶¡£
1.¶Ô¾Ö²¿±äÁ¿(local variables)£¬×Ö¶Î(fields)£¬²ÎÊý(method arguments)ÕâÈýÖÖ±äÁ¿µÄÃüÃûûÓÐÇø·Ö£¬Ôì³ÉÁË´úÂëµÄÔĶÁÀ§ÄÑ£¬Ôö¼ÓÁË´úÂëµÄά»¤³É±¾¡£
×÷Õß¾ÙÁ˸öÀý×Ó:
Java´úÂë
public boolean equals (Object arg) {
if (! (arg instanceof Range)) return false;
Range other = (Range) arg;
return start.equals(other.start) && end.equals(other.end);
}
public boolean equals (Object arg) {
if (! (arg instanceof Range)) return false;
Range other = (Range) arg;
return start.equals(other.start) && end.equals(other.end);
}
ÔÚÕâ¸ö·½·¨ÖУ¬argÖ±½ÓÓÃargumentµÄËõд£¬ËäÈ»´ó¼ÒÒ»¿´¾ÍÖªµÀÕâÊDzÎÊýÁË£¬µ«ÕâÖÖÃüÃû·½Ê½È´¶ªÊ§Á˲ÎÊý´ú±íµÄ¶ÔÏó±¾ÉíµÄº¬Òå¡£´ó¼ÒÖªµÀÕâÊDzÎÊý£¬È´²»ÖªµÀÕâÊÇʲô²ÎÊý¡£Èç¹û·½·¨µÄ²ÎÊý¶àÒ»µã£¬¶¼°´ÕÕarg1£¬arg2ÕâÑùµÄ·½Ê½ÃüÃû£¬ÔĶÁ´úÂëµÄʱºòºÜÍ·ÌÛ¡£ÁíÍâÁ½¸ö×ֶαäÁ¿£¬startºÍend£¬Í»È»Æ¾¿Õ¶ø³ö£¬ÏëһϲÅÖªµÀÕâÓ¦¸ÃÊÇ×ֶΡ£µ±È»£¬Õâ¸ö·½·¨ºÜ¶Ì£¬Ôì³ÉµÄÀ§ÄÑ»¹²»´ó£¬Èç¹ûÕâ¸ö·½·¨±È½Ï³¤µÄ»°£¬Í»È»¿´µ½startºÍendÁ½¸ö±äÁ¿£¬Ò»°ã»áÏÈÔÚÇ°ÃæÕÒÒ»ÏÂÊDz»ÊǾֲ¿±äÁ¿£¬È»ºó²ÅÄÜÈ·¶¨ÊÇÀàµÄ×ֶαäÁ¿¡£
Õâ¸öÎÊÌâòËÆ΢²»×ãµÀ£¬µ«ÎªÊ²Ã´ÒªÈôúÂëÔĶÁÕß»¨·Ñ¶îÍâʱ¼äÔÚÕâЩËöËéµÄÎÊÌâÉÏÄØ£¿Èç¹ûÓиö·½°¸ÄÜÈôúÂëÔĶÁÕßһĿÁËÈ»µÄÃ÷°×±äÁ¿ÊÇÄÇÖÖ±äÁ¿£¬ÎªÊ²Ã´²»²ÉÓÃÄØ£¿¾ÍÈçͬSteve McConnellÔÚ ¡¶´úÂë´óÈ«¡·ÖÐ˵µÄ:"ÈÃÈË·ÑÉñÈ¥×ÁÄ¥ÉñÃØɱÈËÐ×ÊÖÕâûÓÐÎÊÌ⣬µ«Äã²»ÐèÒª×ÁÄ¥³ÌÐò´úÂ룬´úÂëÊÇÓÃÀ´ÔĶÁµÄ¡£"
×÷ÕßÌá³öÁ˽â¾ö·½°¸:
·½·¨²ÎÊýÓÃǰ׺a¿ªÊ¼
Àà×ֶαäÁ¿ÓÃǰ׺f¿ªÊ¼
¾Ö²¿±äÁ¿²»ÓÃǰ׺
ÐÞÕýºóµÄ´úÂëÑùʽӦ¸ÃÊÇ:
Java´úÂë
public boolean equals (Object aOther) {
if (! (aOther instanceof Range)) return false;
Range other = (Range) aOther;
Ïà¹ØÎĵµ£º
ÔÚ Java ÀíÂÛºÍʵ¼ù µÄ Ç°Ò»ÆÚÎÄÕ ÖУ¬Java™ Çå½à¹¤³Ìʦ Brian Goetz ̽¾¿ÁËÈõÒýÓã¨weak references£©£¬ËüÈÃÄú¾¯¸æÀ¬»øÊÕ¼¯Æ÷£¬ÄúÏëҪά»¤Ò»¸ö¶ÔÏóµÄÒýÓ㬶ø²»»á×èÖ¹¸Ã¶ÔÏó±»À¬»øÊÕ¼¯¡£ÔÚ±¾ÆÚÎÄÕÂÖУ¬Ëû½«½âÊÍ Reference ¶ÔÏóµÄÁíÍâÒ»ÖÖÐÎʽ£¬¼´ÈíÒýÓã¨soft references£©£¬ÓÃÓÚ°ïÖúÀ¬»øÊÕ¼¯Æ÷¹ÜÀíÄÚ´æʹÓúÍÏû³ýÇ ......
¡¡¡¡(1) ÀàÃûÊ××ÖĸӦ¸Ã´óд¡£×ֶΡ¢·½·¨ÒÔ¼°¶ÔÏó(¾ä±ú)µÄÊ××ÖĸӦСд¡£¶ÔÓÚËùÓбêʶ·û£¬ÆäÖаüº¬µÄËùÓе¥´Ê¶¼Ó¦½ô¿¿ÔÚÒ»Æ𣬶øÇÒ´óдÖм䵥´ÊµÄÊ××Öĸ¡£ÀýÈ磺
¡¡¡¡ThisIsAClassName
¡¡¡¡thisIsMethodOrFieldName
¡¡¡¡ÈôÔÚ¶¨ÒåÖгöÏÖÁ˳£Êý³õʼ»¯×Ö·û£¬Ôò´óдstatic final»ù±¾ÀàÐͱêʶ·ûÖеÄËùÓÐ×Öĸ¡£ÕâÑù±ã¿É±êÖ¾³öË ......
1.Áоٳö 10¸öJAVAÓïÑÔµÄÓÅÊÆ
a:Ãâ·Ñ£¬¿ªÔ´£¬¿çƽ̨(ƽ̨¶ÀÁ¢ÐÔ)£¬¼òµ¥Ò×Ó㬹¦ÄÜÍêÉÆ£¬ÃæÏò¶ÔÏ󣬽¡×³ÐÔ£¬¶àỊ̈߳¬½á¹¹ÖÐÁ¢£¬ÆóÒµÓ¦ÓõijÉÊìƽ̨, ÎÞÏßÓ¦ÓÃ
2.ÁоٳöJAVAÖÐ10¸öÃæÏò¶ÔÏó±à³ÌµÄÊõÓï
a:°ü£¬À࣬½Ó¿Ú£¬¶ÔÏó£¬ÊôÐÔ£¬·½·¨£¬¹¹ÔìÆ÷£¬¼Ì³Ð£¬·â×°£¬¶à̬£¬³éÏ󣬷¶ÐÍ
3.ÁоٳöJAVAÖÐ6¸ö±È½Ï³£Óõİü
Java. ......
¡¡¡¡MSSQLÖÐÌṩÁ˸ödatediffº¯ÊýÓÃÀ´¶ÔÁ½¸öʱ¼ä½øÐмõ·¨²Ù×÷£¬µ«ÔÚJavaÖÐȴûÓУ¬Èç¹ûÎÒÃÇÏëÖªµÀÁ½¸öÈÕÆÚ¼äÏà¸ôÁ˶àÉÙÌ죬»òÊÇÏà¸ôÁ˶àÉÙ¸öСʱÔòÒªÊÖ¹¤¼ÆËã¡£ÏÂÃæ´úÂëÄ£·ÂMSSQLµÄdatediffº¯ÊýÌṩÁËʹÓò»Í¬Ê±¼ä¼ä¸ôÀ´¼ÆËãÁ½¸öʱ¼äÏà²îµÄʱ¼ä¼ä¸ôµÄÊýÄ¿£¬±ÈÈçtimeIntervalΪdayÔò·µ»ØÏà²îµÄÌìÊý£¬ÎªmonthÔò·µ»ØÏà²îµÄÔÂÊý ......
1. Java ÃüÃûÔ¼¶¨
¡¡¡¡³ýÁËÒÔϼ¸¸öÌØÀýÖ®Í⣬ÃüÃûʱӦʼÖÕ²ÉÓÃÍêÕûµÄÓ¢ÎÄÃèÊö·û¡£´ËÍ⣬һ°ãÓ¦²ÉÓÃСд×Öĸ£¬µ«ÀàÃû¡¢½Ó¿ÚÃûÒÔ¼°Èκηdzõʼµ¥´ÊµÄµÚÒ»¸ö×ÖĸҪ´óд¡£
1.1 Ò»°ã¸ÅÄî
¡¡¡¡* ¾¡Á¿Ê¹ÓÃÍêÕûµÄÓ¢ÎÄÃèÊö·û
¡¡¡¡* ²ÉÓÃÊÊÓÃÓÚÏà¹ØÁìÓòµÄÊõÓï
¡¡¡¡* ²ÉÓôóСд»ìºÏʹÃû×ֿɶÁ
¡¡¡¡* ¾¡Á¿ÉÙÓÃËõд£¬µ«Èç¹û ......