JAVAÏß³ÌÖ®Î壺Ï̵߳Äͬ²½
Èç¹û³ÌÐòÊǵ¥Ị̈߳¬Ö´ÐÐÆðÀ´²»±Øµ£ÐÄ´ËÏ̻߳ᱻÆäËûÏ̴߳òÈÅ£¬¾ÍÏñÔÚÏÖʵÖУ¬Í¬Ò»Ê±¼äÖ»Íê³ÉÒ»¼þÊÂÇ飬¿ÉÒÔ²»Óõ£ÐÄÕâ¼þÊÂÇé»á±»ÆäËûÊÂÇé´òÈÅ¡£µ«ÊÇÈç¹û³ÌÐòÖÐͬʱʹÓöàỊ̈߳¬¾ÍºÃ±ÈÏÖʵÖГÁ½¸öÈËͬʱ½øÈëÒ»ÉÈÃÅ”£¬´Ëʱ¾ÍÐèÒª¿ØÖÆ£¬·ñÔòÈÝÒ××èÈû¡£ÎªÁ˱ÜÃâ¶àÏ̹߳²Ïí×ÊÔ´·¢Éú³åÍ»µÄÇé¿ö£¬Ö»ÒªÔÚÏß³ÌʹÓÃ×ÊԴʱ¸ø¸Ã×ÊÔ´ÉÏÒ»°ÑËø¾Í¿ÉÒÔÁË£¬·ÃÎÊ×ÊÔ´µÄµÚÒ»¸öÏß³ÌΪ×ÊÔ´ÉÏËø£¬ÆäËûÏß³ÌÈôÏëʹÓÃÕâ¸ö×ÊÔ´±ØÐëµÈµ½Ëø½â³ýΪֹ£¬Ëø½â³ýµÄͬʱÁíÒ»¸öÏß³ÌʹÓøÃ×ÊÔ´²¢ÎªÕâ¸ö×ÊÔ´ÉÏËø¡£
ΪÁË´¦ÀíÕâÖÖ¹²Ïí×ÊÔ´¾ºÕù£¬¿ÉÒÔʹÓÃͬ²½»úÖÆ¡£Ëùνͬ²½»úÖÆÖ¸µÄÊÇÁ½¸öÏß³Ìͬʱ×÷ÓÃÔÚÒ»¸ö¶ÔÏóʱ£¬Ó¦¸Ã±£³Ö¶ÔÏóÊý¾ÝµÄͳһÐÔºÍÕûÌåÐÔ¡£JavaÌṩsynchronized¹Ø¼ü×Ö£¬Îª·ÀÖ¹×ÊÔ´³åÍ»ÌṩÁËÄÚÖÃÖ§³Ö¡£¹²Ïí×ÊÔ´Ò»°ãÊÇÎļþ¡¢ÊäÈë/Êä³ö¶Ë¿Ú£¬»òÊÇ´òÓ¡»ú¡£JavaÖÐͬ²½ÓÐÁ½ÖÖÐÎʽ£¬·Ö±ð½éÉÜÈçÏ¡£
Ò»£¬Í¬²½·½·¨
ͬ²½·½·¨½«·ÃÎÊÕâ¸ö×ÊÔ´µÄ·½·¨¶¼±ê¼ÇΪsynchronized£¬ÕâÑùÔÚÐèÒªµ÷ÓÃÕâ¸ö·½·¨µÄÏß³ÌÖ´ÐÐÍê³É֮ǰ£¬ÆäËûµ÷Óñê־Ϊsynchronized()·½·¨µÄÏ̶߳¼»á±»×èÈû¡£¿ÉÒÔʹÓÃÈçÏ´úÂëÉùÃ÷Ò»¸ösynchronized()·½·¨¡£
synchronized void sum(){...} //¶¨ÒåÒ»¸öÈ¡ºÍµÄͬ²½·½·¨
synchronized void max(){...} //¶¨ÒåÒ»¸öÈ¡×î´óÖµµÄͬ²½·½·¨
ÉÏÊö´úÂëÖж¨ÒåÁËÁ½¸öͬ²½·½·¨£¬ÆäÖеÚÒ»¸ö·½·¨ÎªÈ¡ºÍ²Ù×÷£¬µÚ¶þ¸ö·½·¨È¡×î´óÖµ²Ù×÷£¬µ±Á½¸ö·½·¨Í¬Ê±×÷ÓÃÓÚÄÚ´æÖÐͬһ¿éµØַʱ£¬Èç¹û´Ë¶ÔÏóµ÷ÓÃÁËsum()·½·¨£¬´Ëʱmax()·½·¨Ö»Äܵȵ½sum()·½·¨µ÷ÓÃÍê±Ï²¢ÇÒÊÍ·ÅËøÖ®ºó²ÅÄܱ»µ÷Óá£
¿´ÈçÏÂʵÀý£ºsrc\com\wsy\TestSynchronizedThread.javaÍêÕû´úÂ룺
package com.wsy;
public class TestSynchronizedThread extends Thread
{
private char cha;
public TestSynchronizedThread(char cha)
{
this.cha=cha;
}
synchronized void printch()
&
Ïà¹ØÎĵµ£º
javaÖеÄURLEncoderºÍURLDecoderÀà
URLEncoderÀà°üº¬½«×Ö·û´®×ª»»Îªapplication/x-www-form-urlencoded MIME ¸ñʽµÄ¾²Ì¬·½·¨¡£
ΪÁ˽â¾öwebÉè¼ÆÖв»Í¬²Ù×÷ϵͳ¼äµÄ²îÒìÐÔ£¬ÎÒÃÇÔÚURLÖÐʹÓõÄ×Ö·û¾Í±ØÐëÊÇÒ»¸öASCII×Ö·û¼¯µÄ¹Ì¶¨×Ö¼¯ÖеÄÔªËØ£¬¾ßÌåÈçÏ£º
1.´óд×ÖĸA-Z
2.Сд×Öĸa- ......
±¾Îijö×Ô “ÌÆ´óÀÏʦ” ²©¿Í£¬ÇëÎñ±Ø±£Áô´Ë³ö´¦http://tscjsj.blog.51cto.com/412451/84561
public class Bubble {
// ðÅÝÅÅÐòº¯Êý1
public static void bubbleSort1(Comparable []data){
int position,scan;
Comparable temp;
for(position = data.length-1;position>=0;position--){
......
JavaÉè¼Æģʽ֮Facadeģʽ GOF¡¶Éè¼Æģʽ¡·Ò»Êé¶ÔFacadeģʽÊÇÕâÑùÃèÊöµÄ:
¡¡¡¡Îª×ÓϵͳÖеÄÒ»×é½Ó¿ÚÌṩһ¸öͳһ½Ó¿Ú¡£Facadeģʽ¶¨ÒåÁËÒ»¸ö¸ü¸ß²ãµÄ½Ó¿Ú£¬Ê¹×Óϵͳ¸ü¼ÓÈÝÒ×ʹÓá£
¡¡¡¡´óÖÂÒâ˼ÊÇ˵£ºÊ¹ÓÃÒ»ÖÖ±ÈÔÓз½Ê½¸ü¼òµ¥µÄ°ì·¨Óëϵͳ½»»¥¡£ÀýÈ磬ÎÒÃÇ°ÑÒ»¸öºÜÖØÒªµÄÎļþ£¬·ÅÔÚÁ˵ڶþ³éÌëÀ¶øµÚ¶þ¸ö³éÌëµÄÔ ......
Ê×ÏÈ¿´Çå³þ¼¸ÖÖ³£ÓõÄ×Ö·û¼¯±àÂë(javaÓïÑÔÊDzÉÓÃunicode×Ö·û¼¯±àÂëÀ´±íʾ×Ö·ûÓë×Ö·û´®µÄ)£º
¡¡¡¡ASCII(American Standard Code for Information Interchange£¬ÃÀ¹úÐÅÏ¢»¥»»±ê×¼´úÂë)£¬ÊÇ»ùÓÚ³£ÓõÄÓ¢ÎÄ×Ö·ûµÄÒ»Ì×µçÄÔ±àÂëϵͳ¡£ÎÒÃÇÖªµÀÓ¢ÎÄÖо³£Ê¹ÓõÄ×Ö·û¡¢Êý×Ö·ûºÅ±»¼ÆËã»ú´¦Àíʱ¶¼ÊÇÒÔ¶þ½øÖÆÂëµÄÐÎʽ³öÏֵġ£ÕâÖÖ¶þ½ø ......
ÔÚjavaÖУ¬Ê¹ÓÃdouble½øÐÐÔËË㣬ÓÐʱ»á³öÏÖ¾«¶È¶ªÊ§µÄÎÊÌ⣬ֵ»áÓÐÄÇô0.00000***1Æ«²îµÄÆ«²î£¬µ¼ÖÂÆ¥ÅäУÑé³£³£³öÏÖÎÊÌâ
½â¾ö·½°¸ÈçÏÂ:
/**
* ¶ÔdoubleÊý¾Ý½øÐÐÈ¡¾«¶È.
* @param value doubleÊý¾Ý.
* ......