JAVA¹æ·¶Ñ§Ï°——String×ÖÃæ³£Á¿
package testPackage;
class Test {
public static void main(String[] args) {
String hello = "Hello", lo = "lo";
System.out.print((hello == "Hello") + " ");
System.out.print((Other.hello == hello) + " ");
System.out.print((other.Other.hello == hello) + " ");
System.out.print((hello == ("Hel"+"lo")) + " "); //(1)
System.out.print((hello == ("Hel"+lo)) + " "); //(2)
System.out.println(hello == ("Hel"+lo).intern());
}
}
class Other { static String hello = "Hello"; }
package other;
public class Other { static String hello = "Hello"; }
ÔËÐнá¹ûÈçÏ£º
true true true true false true
½á¹û½âÊÍ£º
1. ËùÓÐString×ÖÃæÁ¿£¬²»¹ÜÆäËùÔÚµÄclassºÍpackage£¬¶¼ÊÇͬһ¸öString¶ÔÏóµÄÒýÓÃ
2. ¶ÔÓÚ³£Á¿±í´ïʽ¼ÆËãµÄString£¬¶¼ÊÇÔÚ±àÒëÆÚ¼ä¼ÆËãµÄ£¬±»µ±×÷String×ÖÃæÁ¿¿´´ý¡£ÀýÈç(1)ÐÐËùÔڵĴúÂë
3. ¶ÔÓÚÔÚÔËÐÐÆÚÁ¬½ÓµÄString£¬¶¼ÊÇд´½¨µÄ£¬Òò´Ë²»Ïàͬ¡£ÀýÈç(2)ÐÐËùÔڵĴúÂë
Ïà¹ØÎĵµ£º
ÎÄÕÂÀïÓÐһЩ±í¸ñ£¬javaeyeµÄÌûºÃÏñ²»Ö§³Ö±í¸ñÐÎʽ£¬ÓÐÐËȤ¿ÉÒÔµ½ÎÒµÄblog¿´¿´¡£
http://hzxdark.javaeye.com
Ò»£®JPCAP¼ò½é
ÖÚËùÖÜÖª£¬JAVAÓïÑÔËäÈ»ÔÚTCP/UDP´«Êä·½Ãæ¸øÓèÁËÁ¼ºÃµÄ¶¨Ò壬µ«¶ÔÓÚÍøÂç²ãÒÔϵĿØÖÆ£¬È´ÊÇÎÞÄÜΪÁ¦µÄ¡£JPCAPÀ©Õ¹°üÃÖ²¹ÁËÕâÒ»µã¡£
JPCAPʵ¼ÊÉϲ¢·ÇÒ»¸öÕæÕýȥʵÏÖ¶ÔÊý¾ÝÁ´Â·²ãµÄ¿ØÖÆ£¬¶øÊ ......
Java Learning Path £¨Ò»£©¡¢¹¤¾ßƪ
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJDKÊÇSun¹«Ë¾·¢²¼µÄJDK£¬³ýÁËSunÖ®Í⣬ ......
JavaÐéÄâ»úµÄÆðÔ´Óë¹¹Ôì
µ±ÎÒÃÇ˵µ½“Java”Õâ¸ö´ÊµÄʱºò£¬Ö¸µÄÊÇËĸöÏ໥¹ØÁªµÄ¸ÅÄJavaÓïÑÔ¡¢Java API¡¢Java ClassÎļþ¸ñʽ¡¢JavaÐéÄâ»ú¡£Õû¸öJavaÌåϵÊÇ»ùÓÚJava ÐéÄâ»ú¹¹ÔìµÄ£¬ÕýÒòΪÈç´Ë£¬²ÅÄÜʵÏÖJavaµÄ°²È«ÐÔºÍÍøÂçÒÆ¶¯ÐÔ¡£Java²¢·ÇÊǵÚÒ»¸ö²ÉÓÓÐéÄâ»ú”¸ÅÄîµÄÌåϵ£¬µ«È´ÊǵÚÒ»¸öµÃµ½¹ã·ºÔ ......
1. MD5¼ÓÃÜ£¬³£ÓÃÓÚ¼ÓÃÜÓû§ÃûÃÜÂ룬µ±Óû§Ñé֤ʱ¡£
¡¡ ¡¡protected byte[] encrypt(byte[] obj) ...{
¡¡¡¡try ...{
¡¡¡¡MessageDigest md5 = MessageDigest.getInstance("MD5");
¡¡¡¡md5.update(obj);
¡¡¡¡return md5.digest();
¡¡¡¡} catch (NoSuchAlgorithmException e) ...{
¡¡¡¡e.printStackTrace();
¡ ......
×î½üÔÚÓÃÈóǬÔÚ×öһЩwebÏîÄ¿µÄ±¨±í£¬ÆäÖÐÓÐÒ»¸öÅúÁ¿´òÓ¡µÄ±¨±í¡£ÐèÒª°Ñ²ÎÊý´«µ½±¨±íÀµ±°ÑÖÐÎÄ´«µ½ÀïÃæÊ±×ÜʱÂÒÂ룬²ÉÓÃÁ˸÷ÖÖתÂ뷽ʽ£¬Ò²Ã»×ª¹ýÀ´£¬ÔÎ.........
Ϊʲô»áÓÐÕâô¶àµÄ±àÂ룬ºÃÍ·ÌÛѽ... ......