JAVAµÄ×Ö·û´®Æ´½ÓÓëÐÔÄÜ
ÔÌûµØÖ·:
http://coolshell.cn/?p=2235
----------------ÎÒÊÇ×ÏÔ·×îÃȵķָîÏßXD--------------
¸ÅÊö£º
±¾ÎÄÖ÷ÒªÑо¿µÄÊÇJAVAµÄ×Ö·û´®Æ´½ÓµÄÐÔÄÜ£¬ÔÎÄÖеIJâÊÔ´úÂëÔÚ¹¦ÄÜÉϲ¢²»µÈ¼Û£¬µ¼ÖÂconcatµÄ²â
ÊÔÒâÒå²»´ó¡£²»¹ýÔ×÷ÕßÔÚÆÀÂÛÀ¸¸øÁËеÄconcat½á¹û£¬Èç¹ûÓÐÐËȤµÄͬѧ½¨Òé×Ô¼ºÐ޸ĴúÂë²âÊÔ¡£
ÔÎijö´¦:http://www.venishjoe.net/2009/11/java-string-concatenation-and.html
ÔÚJAVAÖÐÆ´½ÓÁ½¸ö×Ö·û´®µÄ×î¼ò±ãµÄ·½Ê½¾ÍÊÇʹÓòÙ×÷·û”+”ÁË¡£Èç¹ûÄãÓÔ+”À´Á¬½Ó¹Ì¶¨³¤¶ÈµÄ×Ö·û´®£¬¿ÉÄÜÐÔÄÜÉÏ»áÉÔÊÜÓ°Ï죬µ«ÊÇÈç¹ûÄãÊÇÔÚ
Ñ»·ÖÐÀ´”+”¶à¸ö´®µÄ»°£¬ÐÔÄܽ«Ö¸Êý±¶µÄϽµ¡£¼ÙÉèÓÐÒ»¸ö×Ö·û´®£¬ÎÒÃǽ«¶ÔÕâ¸ö×Ö·û´®×ö´óÁ¿Ñ»·Æ´½Ó²Ù×÷£¬Ê¹ÓÔ+”µÄ»°½«µÃµ½×îµÍµÄÐÔÄÜ¡£µ«ÊǾ¿¾¹Õâ
¸öÐÔÄÜÓжà²î£¿Èç¹ûÎÒÃÇͬʱҲ°ÑStringBuffer,StringBuilder»òString.concat()·ÅÈëÐÔÄܲâÊÔÖУ¬½á¹ûÓÖ»áÈçºÎ
ÄØ£¿±¾ÎĽ«»á¾ÍÕâЩÎÊÌâ¸ø³öÒ»¸ö´ð°¸£¡
ÎÒÃǽ«Ê¹ÓÃPer4j
À´
¼ÆËãÐÔÄÜ£¬ÒòΪÕâ¸ö¹¤¾ß¿ÉÒÔ¸øÎÒÃÇÒ»¸öÍêÕûµÄÐÔÄÜÖ¸±ê¼¯ºÏ£¬±ÈÈç×îС£¬×î´óºÄʱ£¬Í³¼Æʱ¼ä¶ÎµÄ±ê׼ƫ²îµÈ¡£ÔÚ²âÊÔ´úÂëÖУ¬ÎªÁ˵õ½Ò»¸ö׼ȷµÄ±ê׼ƫ²îÖµ£¬
ÎÒÃǽ«Ö´ÐÐ20¸öÆ´½Ó”*”50,000´ÎµÄ²âÊÔ¡£ÏÂÃæÊÇÎÒÃǽ«Ê¹Óõ½µÄÆ´½Ó×Ö·û´®µÄ·½·¨£º
Concatenation Operator (+)
String concat method – concat(String str)
StringBuffer append method – append(String str)
StringBuilder append method – append(String str)
×îºó£¬ÎÒÃǽ«¿´¿´×Ö½ÚÂ룬À´Ñо¿ÕâЩ·½·¨µ½µ×ÊÇÈçºÎÖ´Ðеġ£ÏÖÔÚ£¬ÈÃÎÒÃÇÏÈ¿ªÊ¼À´´´½¨ÎÒÞѵÄÀà¡£×¢ÒâΪÁ˼ÆËãÿ¸öÑ»·µÄÐÔÄÜ£¬´úÂëÖеÄÿ¶Î²âÊÔ´úÂë
¶¼ÐèÒªÓÃPer4J¿â½øÐзâ×°¡£Ê×ÏÈÎÒÃÇÏȶ¨Òåµü´ú´ÎÊý
< id="highlighter_449692_clipboard" title="¸´ÖƵ½¼ôÌù°å" type="application/x-shockwave-flash" width="16" height="16" src="http://coolshell.cn/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf" id="highlighter_449692_clipboard" type="application/x-shockwave-flash" title="¸´ÖƵ½¼ôÌù°å" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_449692" menu="false" src="http://coolshell.cn/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf" height="16" width="16">
pri
Ïà¹ØÎĵµ£º
public class MainThread1{
public static void main(String args[]){
MinorThread m1=new MinorThread(1);
MinorThread m2=new MinorThread(2);
new Thread(m1).start();
new Thread(m2).start();
}
}
class MinorThrea ......
Java DB ÕæµÄºÜÉñÆæ°¡.×îÔçÊÇÔÚNetBeansÀïÃæ¿´¼ûÓÐJavaDB.µ«ÊÇ´ÓÀ´Ã»ÓÐÈÏÕæÑо¿¹ýÕâ¸ö¶«Î÷,ÉϸöÐÇÆڲμÓSun ¿Æ¼¼ÈÕÁ˽âÁËһЩJava DBµÄ¶«Î÷¾ö¶¨×Ô¼ºÈ¥³¢ÊÔ,ûÏëµ½ÕæµÄÄÇô¼òµ¥, 2MBµÄÒ»¸öjar·ÅÔÚclasspathÀïÃæÄã¾Í¿ÉÒÔËæʱËæµØµÄʹÓÃÒ»¸öÍêÕûµÄ¹ØϵÊý¾Ý¿â.×îÖÕÓû§¸ù±¾²»ÓÃÈ¥Á˽âËûÃǵijÌÐòºóÃæÓÐÒ»¸öÔõôÑùµÄÊý¾Ý¿â,Äã¿É ......
ÔÚJavaÀïÃ棬Á½¸öÕûÊýÏà³ýµÃµ½ÊǸöÕûÊý£¬±ÈÈç int a = 28;
int b = 10;
a/b == 2; //true
ÔÚFlexÖУ¬ÉÏÃæJava´úÂ뽫·µ»ØͬÑùµÄ½á¹û¡£ÖµµÃ×¢ÒâµÄÊÇ£¬Èç¹ûʹÓõÄÊÇNumberÀ࣬ÔòÓÐËù²»Ò»ÑùÁË¡£ÏÂÃæµÄ´úÂëÖУ¬resultµÄֵΪ2.8¡£Èç¹ûÄ㲻СÐÄ°Ñ·µ»ØµÄ½á¹û×÷ΪÊý×éµÄË÷ÒýȥȡֵµÄ»°£¬ÄÇôʲô½á¹û¶¼Ã»ÓС£
var a:Number = 28 ......
¸Õ¸ÕÔĶÁÁË¡¶Java¼ÓÃÜÓë½âÃܵÄÒÕÊõ¡·Õâ±¾Ê飬¸Ð¾õÊÜÒæ·Ædz¡£
¸ÃÊéÉîÈëdz³ö£¬ÏµÍ³µØ²ûÊöÁËJava¼ÓÃÜÓë½âÃܵÄÏà¹ØÀíÂÛ£¬²¢ÌṩÁ˷ḻµÄʾÀý£¬¶Ô¹¤×÷ÖÐÓû§Ïà¹Ø¼¼ÊõµÄ¶ÁÕߺÜÓаïÖú¡£
ÔĶÁºó£¬ÓÐÒÔÏÂÈýµã¸Ð´¥ºÜÉ
1¡¢±¾Êé¶ÔÓÚJava¼ÓÃÜÓë½âÃÜÁìÓòµÄÀíÂ۵IJûÊöºÜÈ«Ã棬´Óµ±Ç°µÄ°²È«ÎÊÌâµ½ÃÜÂëѧ£¬ÔÙµ½Ö÷Ò ......
²åÈëʽÅÅÐòÔËÐÐЧÂÊN*(N-1)/4 ¶ÔÓÚËæ»úÊý×Ö,Õâ¸öËã·¨±ÈðÅÝ¿ì1±¶,±ÈÑ¡ÔñÅÅÐòÉÔ΢¿ìÒ»µã.
Èç¹ûÊÇ»ù±¾ÓÐÐòµÄ¶ÓÁÐÔòÓÅÊÆ×îΪÃ÷ÏÔÐèÒªO(N)
´úÂëÒ»ÑùÊÇ´ÓðÅÝÅÅÐò¼Ì³ÐÏÂÀ´µÄ.
/**
*
* @author leon.lee
*/
public class InsertSort extends BubbleSort {
public InsertSort(int lengthArray){
......