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

java×Ö·û´®´¦Àí

 1¡¢length() ×Ö·û´®µÄ³¤¶È
¡¡¡¡Àý£ºchar chars[]={'a','b'.'c'};
¡¡¡¡¡¡¡¡String s=new String(chars);
¡¡¡¡¡¡¡¡int len=s.length();
2¡¢charAt() ½ØÈ¡Ò»¸ö×Ö·û
¡¡¡¡Àý£ºchar ch;
¡¡¡¡¡¡¡¡ch="abc".charAt(1); ·µ»Ø'b'
3¡¢getChars() ½ØÈ¡¶à¸ö×Ö·û
¡¡¡¡void getChars(int sourceStart,int sourceEnd,char target[],int targetStart)
¡¡ ¡¡sourceStartÖ¸¶¨ÁË×Ó´®¿ªÊ¼×Ö·ûµÄϱ꣬sourceEndÖ¸¶¨ÁË×Ó´®½áÊøºóµÄÏÂÒ»¸ö×Ö·ûµÄϱꡣÒò´Ë£¬×Ó´®°üº¬´ÓsourceStartµ½ sourceEnd-1µÄ×Ö·û¡£½ÓÊÕ×Ö·ûµÄÊý×éÓÉtargetÖ¸¶¨£¬targetÖпªÊ¼¸´ÖÆ×Ó´®µÄϱêÖµÊÇtargetStart¡£
¡¡¡¡Àý£ºString s="this is a demo of the getChars method.";
¡¡¡¡¡¡¡¡char buf[]=new char[20];
¡¡¡¡¡¡¡¡s.getChars(10,14,buf,0);
4¡¢getBytes()
¡¡¡¡Ìæ´úgetChars()µÄÒ»ÖÖ·½·¨Êǽ«×Ö·û´æ´¢ÔÚ×Ö½ÚÊý×éÖУ¬¸Ã·½·¨¼´getBytes()¡£
5¡¢toCharArray()
6¡¢equals()ºÍequalsIgnoreCase() ±È½ÏÁ½¸ö×Ö·û´®
7¡¢regionMatches() ÓÃÓڱȽÏÒ»¸ö×Ö·û´®ÖÐÌØ¶¨ÇøÓòÓëÁíÒ»ÌØ¶¨ÇøÓò£¬ËüÓÐÒ»¸öÖØÔØµÄÐÎʽÔÊÐíÔڱȽÏÖкöÂÔ´óСд¡£
¡¡¡¡boolean regionMatches(int startIndex,String str2,int str2StartIndex,int numChars)
¡¡¡¡boolean regionMatches(boolean ignoreCase,int startIndex,String str2,int str2StartIndex,int numChars)
8¡¢startsWith()ºÍendsWith()
¡¡¡¡startsWith()·½·¨¾ö¶¨ÊÇ·ñÒÔÌØ¶¨×Ö·û´®¿ªÊ¼£¬endWith()·½·¨¾ö¶¨ÊÇ·ñÒÔÌØ¶¨×Ö·û´®½áÊø
9¡¢equals()ºÍ==
¡¡¡¡equals()·½·¨±È½Ï×Ö·û´®¶ÔÏóÖеÄ×Ö·û£¬==ÔËËã·û±È½ÏÁ½¸ö¶ÔÏóÊÇ·ñÒýÓÃͬһʵÀý¡£
¡¡¡¡Àý£ºString s1="Hello";
¡¡¡¡¡¡¡¡String s2=new String(s1);
¡¡¡¡¡¡¡¡s1.eauals(s2); //true
¡¡¡¡¡¡¡¡s1==s2;//false
10¡¢compareTo()ºÍcompareToIgnoreCase() ±È½Ï×Ö·û´®
11¡¢indexOf()ºÍlastIndexOf()
¡¡¡¡indexOf() ²éÕÒ×Ö·û»òÕß×Ó´®µÚÒ»´Î³öÏֵĵط½¡£
¡¡¡¡lastIndexOf() ²éÕÒ×Ö·û»òÕß×Ó´®ÊǺóÒ»´Î³öÏֵĵط½¡£
12¡¢substring()
¡¡¡¡ËüÓÐÁ½ÖÖÐÎʽ£¬µÚÒ»ÖÖÊÇ£ºString substring(int startIndex)
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ µÚ¶þÖÖÊÇ£ºString substring(int startIndex,int endIndex)
13¡¢concat() Á¬½ÓÁ½¸ö×Ö·û´®
14 ¡¢replace() Ìæ»»
¡¡¡¡ËüÓÐÁ½ÖÖÐÎʽ£¬µÚÒ»ÖÖÐÎʽÓÃÒ»¸ö×Ö·ûÔÚµ÷ÓÃ×Ö·û´®ÖÐËùÓгöÏÖij¸ö×Ö·ûµÄµØ·½½øÐÐÌæ»»£¬ÐÎʽÈçÏ£º
¡¡¡¡String replace(char original,char replacement)
¡¡¡¡ÀýÈ磺Strin


Ïà¹ØÎĵµ£º

java exception javaÒì³£»ã×Ü2009

java exception ½â¾ö·½°¸ - ÎÒµÄÒì³£Íø|Òì³£|exception|myexception 831 - ActionMessages 832 - could not instantiate id generator 833 - javax.servlet.jsp.JspException 834 - javax.naming.NoInitialContextException 835 - net.sf.hibernate.HibernateException 836 - org.hibernate.exception.GenericJDBCExceptio ......

JAVA»ù´¡:³£Á¿Óë±äÁ¿

³£Á¿
    JavaÖеij£Á¿ÖµÊÇÓÃÎÄ×Ö´®±íʾµÄ,ËüÇø·ÖΪ²»Í¬µÄÀàÐÍ,ÈçÕûÐͳ£Á¿123,ʵÐͳ£Á¿1.23,×Ö·û³£Á¿‘a’,²¼¶û³£Á¿true¡¢falseÒÔ¼°×Ö·û´®³£Á¿"This is a constant string."¡£ÓëC¡¢C++²»Í¬,JavaÖв»ÄÜͨ¹ý#defineÃüÁî°ÑÒ»¸ö±êʶ·û¶¨ÒåΪ³£Á¿,¶øÊÇÓùؼü×ÖfinalÀ´ÊµÏÖ,Èç
final double PI=3.14159( ÓÐ ......

java£¬php£¬mysqlʱ¼ä´¦Àí

javaÖÐʱ¼ä´ÁºÍʱ¼ä×Ö·û´®Ö®¼äµÄת»»
»ñÈ¡µ±Ç°µÄunixʱ¼ä´Á
new Date().getTime()
System.currentTimeMillis()
·µ»ØµÄÊǺÁÃëÊý£¬Òª×ª»»long t = System.currentTimeMillis()/1000;
»ñÈ¡µ±Ç°ÄêÔÂÈÕÒÔ¼°Ê±·ÖÃë
Calendar c = Calendar.getInstance();
c.get(Calendar.YEAR))  c.get(Calendar.YEAR))  c.get(C ......

JavaµÄ±³¾°¡¢Ó°Ï켰ǰ¾°

Ò»¡¢±³¾°
    ×î½üÒ»Äê¶àÀ´,ÔÚInternetÉϳöÏÖµÄÌØ±ðÎüÒýÈ˵Äʼþ¾ÍÊÇJavaÓïÑÔºÍÓÃJava±àдµÄä¯ÀÀÆ÷HotJava¡£
1991Äê,SUNMicroSystem¹«Ë¾µÄJameGosling¡¢BillJoeµÈÈË,ΪÔÚµçÊÓ¡¢¿ØÖÆ¿¾Ãæ°üÏäµÈ¼ÒÓÃÏû·ÑÀàµç×Ó²úÆ·ÉϽøÐн»»¥Ê½²Ù×÷¶ø¿ª·¢ÁËÒ»¸öÃûΪOakµÄÈí¼þ(¼´Ò»ÖÖÏðÊ÷µÄÃû×Ö),µ«µ±Ê±²¢Ã»ÓÐÒýÆðÈËÃǵÄ×¢Òâ,Ö±µ½1 ......

ѧϰJAVAʱ¼äÈÕÆÚÀà×ܽ᡾z¡¿

Ò»¡¢PythonÖеÄÎļþ¹ÜÀí
Îļþ¹ÜÀíÊǺܶàÓ¦ÓóÌÐòµÄ»ù±¾¹¦ÄܺÍÖØÒª×é³É²¿·Ö¡£Python¿ÉÒÔʹÎļþ¹ÜÀí¼«Æä¼òµ¥£¬ÌرðÊÇºÍÆäËüÓïÑÔÏà¶Ô±È¡£
ÒÔÏ£¬Peyton McCullough½²½âÁËÎļþ¹ÜÀí»ù´¡¡£
½éÉÜ
ÄãÍæ¹ýµÄÓÎϷʹÓÃÎļþÀ´±£´æ´æµµ£»ÄãÏµĶ©µ¥±£´æÔÚÎļþÖУ»ºÜÃ÷ÏÔ£¬ÄãÔçÉÏдµÄ±¨¸æÒ²±£´æÔÚÎļþÖС£
¼¸ºõÒÔÈκÎÓïÑÔ±àдµÄÖÚ¶àÓ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ