javaÖеÄString³Ø
ÔÚ½øÈëÎÒÃǽñÌìµÄ»°ÌâÇ°£¬ÏÈÀ´¿´¿´ÏÂÃæÕâ¶Î´úÂ룬ÄãÖªµÀËüµÄ½á¹ûÂð£¿
³ÌÐò´úÂë
public class StringTest1{
public static void main(String[] args) {
String str1 = "abc";
String str2 = "abc";
System.out.println(str1 == str2);
}
}
¡¡¡¡ ÕýÈ·´ð°¸Ó¦¸ÃÊÇtrue¡£ÔÙÀ´¿´ÏÂÃæÕâ¶Î´úÂ룺
³ÌÐò´úÂë
public class StringTest2 {
public static void main(String[] args) {
String str1 = new String("abc");
String str2 = new String("abc");
System.out.println(str1 == str2);
}
}
¡¡¡¡ ÕýÈ·´ð°¸ÊÇfalse¡£
¡¡¡¡ ÖÚËùÖÜÖª£¬javaµÄStringÊDz»¿É¸Ä±äµÄ×Ö·û´®¶ÔÏó¡£ÎªÁËÌá¸ßЧÂÊ£¬javaΪStringÀàÌṩÁË´®³Ø¡£ÕýÈç´ó¼ÒËù¿´µ½µÄÄÇÑù£¬ÔÚStringTest1ÖоÍʹÓÃÁË´®³Ø¡£µ±ÄãÖØÐÂÉùÃ÷Ò»¸öStringÐͱäÁ¿Îªabcʱ£¬½«Ê¹Óô®³ØÀïÔÀ´µÄÄǸöabc£¬¶ø²»ÖØзÖÅäÄڴ棬Ҳ¾ÍÊÇ˵£¬str2Óëstr1½«»áÖ¸Ïòͬһ¿éÄÚ´æ¡£ËùÒÔ½á¹ûΪtrue¡£ÔÚStringTest2ÖÐʹÓÃÁËÆÕͨ¶ÔÏóµÄÉùÃ÷·½Ê½£¬ÏµÍ³½«»áΪstr1ºÍstr2¸÷·ÖÅäÒ»¿éÄÚ´æ¡£ËùÒÔ½á¹ûΪfalse¡£
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
Java¸ß¼¶££JavaÏß³ÌÔËÐÐÕ»ÐÅÏ¢µÄ»ñÈ¡
·¢²¼Ê±¼ä£º2007.11.14 05:10 À´Ô´£ºÈüµÏÍø¼¼ÊõÉçÇø ×÷Õߣºbaocl
Ò»¡¢ÎÊÌâµÄÒýÈë
ÎÒÃÇÔÚJava³ÌÐòÖÐʹÓÃÈÕÖ¾¹¦ÄÜ£¨JDK Log»òÕßLog4J£©µÄʱºò£¬»á·¢ÏÖLogϵͳ»á×Ô¶¯°ïÎÒÃÇ´òÓ¡³ö·á¸»µÄÐÅÏ¢£¬¸ñʽһ°ãÈçÏ£º
[ÔËÐÐʱ¼ä] [µ ......
Éè¼ÆÒ»¸öCircleÀ࣬ÆäÊôÐÔΪԵ㣨ÀàÐÍΪÀàMyPoint£©ºÍ°ë¾¶£¬²¢Îª´ËÀà±àдÒÔÏÂÈý¸ö·½·¨£º
Ò»¡¢¼ÆËãÔ²µÄÃæ»ýµÄcalArea£¨£©·½·¨£»
¶þ¡¢¼ÆËãÖܳ¤µÄcalLength£¨£©·½·¨£»
Èý¡¢boolean inCircle£¨MyPoint mp£©·½·¨£¬¹¦ÄÜÊDzâÊÔ×÷Ϊ²ÎÊýµÄij¸öµãÊÇ·ñÔÚµ±Ç°¶ÔÏóÔ²ÄÚ£¨Ô²ÄÚ£¬°üÀ¨Ô²ÉÏ·µ»Øtrue£¬ÔÚÔ²Íâ·µ»Øfalse£©¡£
³ÌÐò£º
clas ......
java exception ½â¾ö·½°¸ - ÎÒµÄÒì³£Íø|Òì³£|exception 791 - java.lang.NoSuchMethodError 792 - RuntimeException 793 - org.hibernate.exception.SQLGrammarException 794 - Internal Error 795 - ×Ô¶¨ÒåÒì³£ 796 - org.dom4j.DocumentException 797 - java.net.SocketException 798 - Exception¶ÔÏó 799 - SQLE ......