Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÉîÈëÁ˽âjavaÖеÄString¶ÔÏó

Ô­ÌûµØÖ·http://blog.pfan.cn/txdnet/36493.html
Ò»,´Ó¸ù±¾ÉÏÈÏʶjava.lang.StringÀàºÍString³Ø
Ê×ÏÈ,ÎÒ½¨ÒéÏÈ¿´¿´StringÀàµÄÔ´ÂëʵÏÖ,ÕâÊÇ´Ó±¾ÖÊÉÏÈÏʶStringÀàµÄ¸ù±¾³ö·¢µã.´ÓÖпÉÒÔ¿´µ½:
1,StringÀàÊÇfinalµÄ,²»¿É±»¼Ì³Ð.public final class String.
2,StringÀàÊǵı¾ÖÊÊÇ×Ö·ûÊý×échar[], ²¢ÇÒÆäÖµ²»¿É¸Ä±ä.private final char value[];
È»ºó´ò¿ªStringÀàµÄAPIÎĵµ,¿ÉÒÔ·¢ÏÖ:
3,StringÀà¶ÔÏóÓиöÌØÊâµÄ´´½¨µÄ·½Ê½,¾ÍÊÇÖ±½ÓÖ¸¶¨±ÈÈçString x = "abc","abc"¾Í±íʾһ¸ö×Ö·û´®¶ÔÏó.¶øxÊÇ"abc"¶ÔÏóµÄµØÖ·,Ò²½Ð×ö"abc"¶ÔÏóµÄÒýÓÃ.
4,String¶ÔÏó¿ÉÒÔͨ¹ý"+"´®Áª.´®Áªºó»áÉú³ÉеÄ×Ö·û´®.Ò²¿ÉÒÔͨ¹ýconcat()À´´®Áª,Õâ¸öºóÃæ»á½²Êö. 5,´´½¨×Ö·û´®µÄ·½Ê½ºÜ¶à,¹éÄÉÆðÀ´ÓÐÈýÀà:
ÆäÒ»,ʹÓÃnew¹Ø¼ü×Ö´´½¨×Ö·û´®,±ÈÈçString s1 = new String("abc");
Æä¶þ,Ö±½ÓÖ¸¶¨.±ÈÈçString s2 = "abc";
ÆäÈý,ʹÓô®ÁªÉú³ÉеÄ×Ö·û´®.±ÈÈçString s3 = "ab" + "c";
6,Java ÔËÐÐʱ»áά»¤Ò»¸öString Pool(String³Ø),JavaDoc·­ÒëºÜÄ£ºý"×Ö·û´®»º³åÇø".String³ØÓÃÀ´´æ·ÅÔËÐÐʱÖвúÉúµÄ¸÷ÖÖ×Ö·û´®,²¢ÇÒ³ØÖеÄ×Ö·û´®µÄÄÚÈݲ»Öظ´.¶øÒ»°ã¶ÔÏó²»´æÔÚÕâ¸ö»º³å³Ø,²¢ÇÒ´´½¨µÄ¶ÔÏó½ö½ö´æÔÚÓÚ·½·¨µÄ¶ÑÕ»Çø.ÏÂÃæÊǸöϵͳÄÚ´æʾÒâͼ:
¶þ,String¶ÔÏóµÄ´´½¨
String¶ÔÏóµÄ´´½¨Ò²ºÜ½²¾¿,¹Ø¼üÊÇÒªÃ÷°×ÆäÔ­Àí.
Ô­Àí1:µ±Ê¹ÓÃÈκη½Ê½À´´´½¨Ò»¸ö×Ö·û´®¶ÔÏósʱ,JavaÔËÐÐʱ(ÔËÐÐÖÐJVM)»áÄÃ×ÅÕâ¸öXÔÚString³ØÖÐÕÒÊÇ·ñ´æÔÚÄÚÈÝÏàͬµÄ×Ö·û´®¶ÔÏó,Èç¹û²»´æÔÚ,ÔòÔÚ³ØÖд´½¨Ò»¸ö×Ö·û´®s,·ñÔò,²»ÔÚ³ØÖÐÌí¼Ó.
Ô­Àí2:JavaÖÐ,ֻҪʹÓÃnew¹Ø¼ü×ÖÀ´´´½¨¶ÔÏó,ÔòÒ»¶¨»á(ÔÚ¶ÑÇø»òÕ»Çø)´´½¨Ò»¸öеĶÔÏó.
Ô­Àí3:ʹÓÃÖ±½ÓÖ¸¶¨»òÕßʹÓô¿×Ö·û´®´®ÁªÀ´´´½¨String¶ÔÏó,Ôò½ö½ö»á¼ì²éά»¤String³ØÖеÄ×Ö·û´®,³ØÖÐûÓоÍÔÚ³ØÖд´½¨Ò»¸ö,ÓÐÔò°ÕÁË!µ«¾ø²»»áÔÚ¶ÑÕ»ÇøÔÙÈ¥´´½¨¸ÃString¶ÔÏó.
Ô­Àí4:ʹÓðüº¬±äÁ¿µÄ±í´ïʽÀ´´´½¨String¶ÔÏó,Ôò²»½ö»á¼ì²éά»¤String³Ø,¶øÇÒ»¹»áÔÚ¶ÑÕ»Çø´´½¨Ò»¸öString¶ÔÏó.
ÁíÍâ,StringµÄintern()·½·¨ÊÇÒ»¸ö±¾µØ·½·¨,¶¨ÒåΪpublic native String intern(); intern()·½·¨µÄ¼ÛÖµÔÚÓÚÈÿª·¢ÕßÄܽ«×¢ÒâÁ¦¼¯Öе½String³ØÉÏ.µ±µ÷Óà intern ·½·¨Ê±,Èç¹û³ØÒѾ­°üº¬Ò»¸öµÈÓÚ´Ë String ¶ÔÏóµÄ×Ö·û´®(¸Ã¶ÔÏóÓÉ equals(Object) ·½·¨È·¶¨),Ôò·µ»Ø³ØÖеÄ×Ö·û´®.·ñÔò,½«´Ë String ¶ÔÏóÌí¼Óµ½³ØÖÐ,²¢ÇÒ·µ»Ø´Ë String ¶ÔÏóµÄÒýÓÃ.
×îºó,Óм¸µãÎÊÌâÇë´ó¼Ò×¢Òâ:String a; ÓëString a=nullÔÚ×÷


Ïà¹ØÎĵµ£º

java native interface(JNI)¼¼Êõ¼òµ¥Ó¦ÓÃ

      ÊÖÉÏÒ»¸öÏîÄ¿ÐèҪͨ¹ýusb¿ÚÈ¥¶ÁÈ¡usbkeyµÄÐÅÏ¢£¬³§¼ÒÌṩµÄÖ»ÓÐC/C++µÄ½Ó¿Ú£¬¶øÖ÷Ó¦ÓÃÊÇjavaµÄ£¬ËùÒÔÐèҪʹÓÃjavaÈ¥µ÷Óö¯Ì¬Á´½Ó¿â£¬ËùÒÔ»¨Á˵ãʱ¼äÑо¿ÁËÏÂJNI¼¼Êõ£¬jdk¶ÔJNI¼¼Êõ·â×°µÃºÜµ½Î»£¬Ê¹ÓÃÆðÀ´·Ç³£¼òµ¥£¬JNI¼¼Êõ×î¹Ø¼ü»¹ÊÇÔÚÓÚjniÊý¾ÝÀàÐͺͱ¾µØÊý¾ÝÀàÐ͵Äת»»¡£Ïȼòµ¥ÂÞÁÐÏÂJNIµ ......

ѧϰJavaÀàµÄÊôÐÔ

ѧϰJavaÀàµÄÊôÐÔ-Î人±±´óÇàÄñ
¡¡¡¡Public¡¢private¡¢protectedÏÔʾÁËÈýÖÖÀàÖеÄÊôÐԺͷþÎñµÄÀàÐÍ£¬publicÊÇ¿ÉÒÔËæÒâ·ÃÎʵġ¢privateÊÇÍâ½ç²»ÄÜ·ÃÎʵÄ(ÏÔʾÁËÊý¾ÝµÄ·â×°ÐÔ)¡¢protected˵Ã÷Êý¾ÝÊÇÊܱ£»¤µÄ¡£ÏÂÃæ¾ÍÀ´Ïêϸ½²ÊöÒ»ÏÂÕâÈý¸ö¾¿¾¹ÓÐʲôÇø±ð¡£
¡¡¡¡Ê×ÏÈÒªÁ˽âһϰüµÄ¸ÅÄî¡£ÓÐÈô¸É¸öÀ࣬ËüÃÇÏ໥֮¼äÓÐÒ»¶¨µÄ¹ØÏ ......

JavaÕ»Óë¶Ñ

1. Õ»(stack)Óë¶Ñ(heap)¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
2. Õ»µÄÓÅÊÆÊÇ£¬´æÈ¡ËٶȱȶÑÒª¿ì£¬½ö´ÎÓÚÖ±½ÓλÓÚCPUÖеļĴæÆ÷¡£µ«È±µãÊÇ£¬´æÔÚÕ»ÖеÄÊý¾Ý´óСÓëÉú´æÆÚ±ØÐëÊÇÈ·¶¨µÄ£¬È±·¦Áé»îÐÔ¡£ÁíÍ⣬ջÊý¾Ý¿ÉÒÔ¹²Ïí£¬Ïê¼ûµÚ3µã¡£¶ÑµÄÓÅÊÆÊÇ¿ÉÒÔ¶¯Ì¬µØ·ÖÅä ......

JAVA¶¯Ì¬µ÷ÓÃWeb Services

·þÎñ¶ËµÄwebservicesµÄ·¢²¼ÊÇ»ùÓÚjax-ws¹æ·¶·¢²¼µÄ¡£ÏÂÃæÊÇ¿Í»§¶Ë¶¯Ì¬µ÷ÓõĴúÂ룬µ÷ÓõÄweb·þÎñÊÇ¿ÉÅäÖõġ£
1£ºÔÚxmlÎĵµÀïÅäÖÃwebservicesµÄwsdlµØÖ·£¬¶Ë¿ÚÃûºÍ²Ù×÷Ãû
2£ºÌṩһ¸ö·½·¨¶ÁÈ¡xmlÎĵµ£¬·µ»ØÒ»¸öList
     List list= ReadAndWriteXML.getWebServiceWsdlList();
   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ