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

ʹÓÃJAVA½¨Á¢Îȶ¨µÄ¶àÏ̷߳þÎñÆ÷

 
±¾ÎÄÏêϸµÄ½éÉÜÁËʹÓÃJavaÓïÑÔ½¨Á¢Ò»Ì׶àÏ̷߳þÎñÆ÷µÄ¹ý³Ì£¬¸Ã·þÎñÆ÷ʹÓöÔÏó´«µÝÏûÏ¢£¬ÔÚÏß³ÌÖÐʹÓöÓÁлúÖÆ£¬Ê¹·þÎñÆ÷µÄÐÔÄÜ´ó´óÌá¸ßÁË¡£ÕâÌ×·þÎñÆ÷¿ÉÒÔ±»ÓÃÓÚ¸÷ÖÖC/S»òB/S½á¹¹µÄÓ¦ÓóÌÐòÖС£
JavaÓïÑÔÊÇÍêÈ«ÃæÏò¶ÔÏó
µÄ£¬ËüµÄÏ̻߳úÖƺͶÔÏóÐòÁл¯ÌرðÈÝÒ×ʹÓã¬Ê¹ÓÃJavaÀ´½¨Á¢Ò»Ì׶àÏ̷߳þÎñÆ÷Òª±ÈʹÓÃÆäËüÓïÑÔ·½±ãµÄ¶à£¬Èç¹ûÄãÔÙ°ÑËüµÄÒì³£´¦Àí»úÖÆÀûÓúã¬ÄÇôÄã¾Í
¿ÉÒÔ½¨Á¢Ò»¸öÉÌÒµ¼¶µÄ¶àÏ̷߳þÎñÆ÷ÁË¡£ÓÉÓÚ²ÉÓÃÁËÏûÏ¢¶ÓÁкÍSocket´«Ê䷽ʽ£¬ËùÒÔ²»»á³öÏÖ¶ªÏûÏ¢µÄÎÊÌâ¡£ÕâÌ×·þÎñÆ÷¿ÉÒÔ×÷ΪʵʱÁÄÌì·þÎñÆ÷¡¢¶àÈËЭ
ͬµÄЭ×÷·þÎñÆ÷µÈµÈ¡£
ÏûϢϵͳµÄ½¨Á¢
ÕâÌ×·þÎñÆ÷µÄÏûϢϵͳ²ÉÓõÄÊǶÔÏó´«ÊäµÄ»úÖÆ£¬¶ø²»ÊÇÒÔÇ°³£³£Ê¹ÓõÄ×Ö·û´®´«Êä¡£²ÉÓöÔÏó´«ÊäµÄºÃ´¦ÊÇÀ©Õ¹·½±ã£¬ÈçÐèÒª½¨Á¢Ò»¸öеÄÏûÏ¢Ö»ÐèÒª´ÓÒ»¸öͳһµÄ»ùÀà¼Ì³ÐÏÂÀ´£¬È»ºóÔÙд×Ô¼ºÊµÏֵķ½·¨¾ÍÐÐÁË¡£ÕâÑùÒ²·ûºÏÃæÏò¶ÔÏóÁìÓòÀïÒ»ÌõÖØÒªµÄÔ­Ôò£º
OCP(open_closed Principle)
£¬¼´Ò»¸öºÃµÄÉè¼ÆÓ¦¸ÃÄܹ»ÈÝÄÉÐµĹ¦ÄܵÄÔö¼Ó£¬µ«ÊÇÔö¼ÓµÄ·½Ê½²»ÊÇÐÞ¸ÄÔ­ÓеÄÀ࣬¶øÊÇÌí¼ÓеÄÀà¡£

Ê×
ÏȽ¨Á¢Ò»¸ö»ùÀࣺMsg£¬¸Ã³éÏóÀàÖÐÓÐÁ½¸öÓòsenderºÍreceiver·Ö±ð¼Í¼ÏûÏ¢µÄ·¢ËÍÕߺͽÓÊÕÕß¡£ÕâÁ½¸öÓòÊÇÔÚ¹¹ÔìÏûÏ¢Ààʱ¾ÍÌîд
µÄ£¬receiverÓò¿ÉÒÔΪ¿Õ£¬¿Õ±íʾ·¢¸øË­¶¼¿ÉÒÔ£¬ÓÉת·¢·þÎñÆ÷À´¾ö¶¨¡£¸ÃÀàµÄ·½·¨°üÀ¨È¡µÃÕâÁ½¸öÓòµÄÖµºÍÏûÏ¢µÄ´¦Àíº¯Êý¡£ÏûÏ¢µÄ´¦Àíº¯Êý
process()ÊÇ¿Õº¯Êý£¬¹©¼Ì³ÐÕßÖØÔØ¡£
½¨Á¢ÁËÕâ¸ö³éÏó»ùÀàºó£¬Äã¾Í¿ÉÒԼ̳ÐËüÍê³ÉÄã×Ô¼ºµÄÀà¡£¾Ù¸öÀý×Ó£¬¼ÙÈçÎÒÒª½¨Á¢Ò»¸ö·Ö×éЭͬ¹¤×÷µÄ»æͼϵͳ£¬¶øÇÒÖ§³Ö×éÔ±Ö®¼äµÄ¶Ô»°£¬ÄÇôÎÒ¿ÉÒÔ½¨Á¢ÈçϵÄÀ༯ºÏ£º
SendTextMsg(String sender,String receiver,String info)//ÏòÖ¸¶¨µÄÈË·¢ËͶԻ°¡£

AddLineMsg(String sender,Point a,Point b)//ÔÚÖ¸¶¨µÄµãÖ®¼ä»æÖÆÒ»ÌõÖ±Ïß

AddRectangle(String sender,point start,Point end)//½¨Á¢Ö¸¶¨µÄ¾ØÐÎ

AddRotundaMsg(String sender,Point center,int radius)//½¨Á¢Ö¸¶¨µÄÔ²

RemoveObjectMsg(String sender,int ID)//ɾ³ýÖ¸¶¨±àºÅµÄͼÐζÔÏó

……

ÒÔ´ËÀàÍÆ£¬¿ÉÒÔ½¨Á¢ºÜ¶àµÄÏûÏ¢Àà¡£ÔÚÿ¸öÀàµÄÄÚ²¿¶¼ÓÉÒ»¸ö´¦Àí¸ÃÀàµÄ·½·¨process()£¬Ìîд¸Ã·½·¨¾Í¿ÉÒÔʵÏÖ¶ÔÏûÏ¢ÀàµÄ´¦Àí£¬¶ø·þÎñÆ÷Ö»¸ºÔðÍê³ÉÏûÏ¢µÄת·¢¹¦ÄÜ¡£ÕâÑù£¬Ò»Ì×ÏûϢϵͳ¾Í½¨Á¢ÁË¡£
»ØÒ³Ê×
·þÎñÆ÷µÄ½á¹¹
Èç¹ûÒª·þÎñÆ÷ʵÏÖͬʱΪÿ¸ö¿Í»§¶Ë


Ïà¹ØÎĵµ£º

Java NIO APIÏê½â

 
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......

java¸ñʽ»¯Êä³ö

 importjava.text.DecimalFormat;
¡¡¡¡
publicclassTestNumberFormat{
¡¡¡¡
¡¡¡¡publicstaticvoidmain(String[]args){
¡¡¡¡¡¡¡¡doublepi=3.1415927;¡¡//Ô²ÖÜÂÊ
¡¡¡¡¡¡¡¡//ȡһλÕûÊý
¡¡¡¡¡¡¡¡System.out.println(newDecimalFormat("0").format(pi));¡¡¡¡¡¡//3
¡¡¡¡¡¡¡¡//ȡһλÕûÊýºÍÁ½Î»Ð¡Êý
¡¡¡¡¡¡¡¡System ......

JavaÍøÂç±à³Ì³õ²½

JavaÍøÂç±à³Ì³õ²½
Kagula
2009-11-23
¹Ø¼ü´Ê
Java  Socket  DataInputStream   DataOutputStream
¸ÅÒª
    ʹÓÃJavaͬ²½IOÓ¦ÓóÌÐò¿â£¬ÊµÏÖCS½á¹¹ÍøÂç±à³Ì¡£
ÕýÎÄ
ʹÓÃSocketÀ´½¨Á¢ÍøÂçÁ¬½Ó£¬Ê¹ÓÃDataInputStream¡¢DataOutputStreamÀ´´æÈ¡ÍøÂçÁ÷¡£
 
¿Í»§¶Ë²¿·Ý
µÚÒ»²½ ......

JVMÄÚ´æ¶Î·ÖÅ䣬JavaÀ¬»ø»ØÊÕµ÷ÓÅ£¬HeapÉ趨

 http://hi.baidu.com/kingtckingtc/blog/item/ca5606f4decd5767ddc4740b.html
JVMÄÚ´æ¶Î·ÖÅ䣬JavaÀ¬»ø»ØÊÕµ÷ÓÅ£¬HeapÉ趨
2009Äê09ÔÂ08ÈÕ ÐÇÆÚ¶þ 14:57
1. JVMÄÚ´æ¶Î·ÖÅä¼°Æô¶¯²ÎÊý£º
J2EE·þÎñÆ÷µÄÄÚ´æ×é³É£º
? Java¶Ñ£ºÎÒÃǵijÌÐòºÍ¶ÔÏó¶¼ÔÚÕâ¸ö¶Ñ½øÐйÜÀí
? C¶Ñ£ºµ±ÒýÓõ½Ò»Ð©NativeµÄ¶ÔÏó£¬ÈçÍøÂç·ÃÎÊ¡¢OCI ......

Java

ÁªÍ¨£º³¹µ×·ÅÆúORÓûÇܹÊ×Ý£¿
 
ÒµÄÚÈÕÇ°´«³öÏûÏ¢£¬ÓÉÓÚÆ»¹û¼á³Ö·Ö³Éģʽ£¬ÁªÍ¨¸ß²ã¶ÔÓÚÒýÈëÆ»¹û̬¶ÈÒÑÎÞÔçÏȼá¾ö¡£“Ëæ×ÅÊÖ»úµÄ²»¶Ï¸üл»´ú£¬Ò»µãÓпÉÄÜ°üº¬µÄ¹¦ÄÜÌرðÊÇÁªÍ¨¼ÓÈë¹È¸è¿ª·ÅÊÖ»úÁªÃË£¬ÔÚÊý¾Ý±£»¤ºÍ¼á¹ÌЭ×÷¼Æ»®ÍÆ×ÔÓпª·Å²Ù×÷ƽ̨ÊÖ»ú£¬ÔÚÊý¾Ý±£»¤ºÍ¼á¹ÌЭ×÷ javaµç×ÓÊéÃâ·ÑÏÂÔØiPhoneÔÚÆäÕ½ÂÔÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ