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

ÈȵãÌÖÂÛ£ºJava±à³Ì·ç¸ñµÄ¸Ä±ä


×î½üStephan SchmidtÔÚ²©¿ÍÖз¢±íÁËÌâΪ¡¶ÏÂÒ»´úJava±à³Ì·ç¸ñ¡·µÄÎÄÕ£¬²ûÊöÁËËûÑÛÖÐJava±à³Ì·ç¸ñµÄ¸Ä±ä£¬ÒÔ¼°Î´À´µÄ×ßÏò£ºÐí¶à¹«Ë¾ºÍ¿ª·¢ÈËÔ±ÕýÔÚ´ÓJavaתÏòÆäËû±à³ÌÓïÑÔ£ºRuby¡¢Python¡¢Groovy¡¢Erlang»òScalaµÈµÈ¡£²»¹ýÄã¿ÉÄÜ×ö²»µ½ÕâÒ» µã¡£¼´±ãÈç´Ë£¬ÄãÒ²¿ÉÒԸıäÄãµÄ±à³Ì·ç¸ñ£¬»ñÈ¡ÕâЩÐÂÓïÑÔµÄÓÅÊÆ¡£ÊÂʵÉÏ£¬ÔÚ¹ýÈ¥µÄ15ÄêÖУ¬Java±à³Ì·ç¸ñÒ²ÒѾ­ÓÐÃ÷ÏԱ仯ÁË¡£
StephanÔÚÎÄÕÂÖÐÌá³öÁËÒÔϼ¸µã£º
¾¡¿ÉÄܵرê×¢final£ºÈÃËùÓж«Î÷²»¿É±ä£¬°Ñ±äÁ¿±êΪfinal¿ÉÒÔ×èÖ¹¸Ä±äËüµÄÖµ¡£ºÜ¶àʱºò£¬ÖØÐÂΪ±äÁ¿¸³Öµ»áÒýÈëbug£¬ÄãÓ¦¸ÃʹÓÃеıäÁ¿¡£³ý´ËÖ®Í⣬final¿ÉÒÔÌá¸ß´úÂëµÄ¿É¶ÁÐÔ¡£ÎÒÕë¶ÔÕâ¸ö»°Ì⻹д¹ýһƪÎÄÕ£º¡¶JavaÖÐËùÓбäÁ¿¶¼Ó¦¸ÃÊÇfinalµÄ¡·
ûÓÐsetter£ºÐí¶àJava³ÌÐòÔ±»á×ÔÈ»¶øÈ»µØΪÀàÖÐËùÓеÄ×ֶμÓÉÏsetter¡£Ë¼¿¼Ò»Ï£¬ÕæµÄÿ¸ö×ֶζ¼ÐèÒªÐÞ¸ÄÂ𣿸üºÃµÄ·½·¨ÊÇ´´½¨°üº¬¸Ä±äºó״̬µÄжÔÏó¡£´ËÍ⣬ҲÊÔ×ÅÈ¥³ýgetter£¬ÎÒÃÇÓ¦¸Ã×ñÑ­“Tell, don’t ask”µÄ˼Ïë¡£
±ÜÃâʹÓÃÑ­»·À´²Ù×÷List£º´Óº¯Êýʽ±à³ÌÄÇÀï»ñµÃµÄ¾­Ñ飬ѭ»·²¢²»ÊǽøÐм¯ºÏ²Ù×÷×îºÃ·½·¨¡£ÀýÈ磬ÎÒÃÇ¿ÉÒÔʹÓÃGoogle CollectionsÌṩµÄ¹ýÂ˹¦ÄÜ¡£
Predicate canDrinkBeer = new Predicate() {
public boolean apply(HasAge hasAge) {
return hasAge.isOlderThan( 16 );
}
};
List<Person> beerDrinkers = filter(persons, canDrinkBeer);
ʹÓõ¥ÐдúÂ룺JavaÊÇÒ»ÃÅ·±ÔÓ£¨noisy£©µÄÓïÑÔ£¬ÎÒÃÇÓ¦¸Ã±àд¸ü¾«È·µÄ´úÂë¡£³¢ÊÔ½«´úÂëдΪһÐС£ÀýÈ磺
public int add(int a, int b) { return a + b; }
ʹÓôóÁ¿½Ó¿Ú£ºÁìÓòÇý¶¯Éè¼ÆÒѾ­´óÐÐÆäµÀ£¬Ò»¸öÓ¦¸Ã²ð·ÖΪ¶àÖÖ“½ÇÉ«”£¬¼´ÊµÏÖ¶àÖÖ½Ó¿Ú£¬Ìá¸ß¸´Óó̶ȡ£·½·¨Ó¦¸ÃÃæÏò“½ÇÉ«”£¬¶ø²»ÊÇÃæÏòÌض¨µÄÀà¡£ÎÒÔÚ¡¶²»ÒªÔÚJavaÖÐʹÓÃString¡·Ò»ÎÄÖÐÌÖÂÛÁ˸ü¶àÕâ·½ÃæµÄÄÚÈÝ¡£
ʹÓÃErlang·ç¸ñµÄ²¢·¢£ºJavaµÄ²¢·¢ÌØÐÔ£¨ÈçlockºÍsynchronized£©¹ýÓڵͶˣ¬ÄÑÒÔʹÓá£Erlang·ç¸ñµÄ²¢·¢ÊÇÒ»ÖÖ¸üºÃµÄ×ö·¨¡£Javaƽ̨ÉÏÒѾ­ÓÐÁËAkkaºÍActorom¡£´ËÍ⣬Ҳ¿ÉÒÔʹÓÃjava.util.concurrentÖеÄJoin/ForkºÍÊý¾Ý½á¹¹½øÐбà³Ì¡£
ʹÓÃFluent Interface£ºFluent Interface¿ÉÒÔʹ´úÂë¸ü¶Ì£¬¸üÈÝÒ×±àд¡£Google CollectionsÖеÄMapMakerÊǸö²»´íµÄʾÀý£º
ConcurrentMap graphs = new MapMaker()
.concurrencyLevel(32)
.softKeys()
.weakValues()
.expiration(3


Ïà¹ØÎĵµ£º

JAVAѧϰ±Ê¼Ç(1)

jdk,j2ee,j2se,j2meµÄ¸ÅÄîÇø±ð
1.
JDKÊÇJava development toolkit,Ï൱ÓÚÊÇJavaµÄ¿âº¯Êý£¬ÊDZàÒ룬ÔËÐÐjava³ÌÐòµÄ¹¤¾ß°ü¡£
J2EEÊÇJava 2 enterprise editionÊÇJavaµÄÒ»ÖÖÆóÒµ°æÓÃÓÚÆóÒµ¼¶µÄÓ¦Ó÷þÎñ¿ª·¢
J2SEÊÇJava 2 standard editionÊÇJavaµÄ±ê×¼°æ,ÓÃÓÚ±ê×¼µÄÓ¦Óÿª·¢
J2MEÊÇJava 2 Micro EditionÊÇJavaµÄ΢ÐÍ°æ,³£ ......

Çë½ÌһЩ¹ØÓÚJAVAÃæÊÔÎÊÌâ Óкܶà лл´ó¼Ò°ïæ

Ìâ    Ä¿
javaÓëC#Ïà±È£¬JavaµÄÓÅÊÆÔÚÄÄÀ
 
    1.strutsÔË×÷¹ý³Ì,hibernateµÄ×÷ÓÃ
 
hibernateÖУ¬ÔõôÅжÏÊDzåÈ뻹ÊǸüÐÂ?
 
ÔõôʹÓÃjavascript½øÐÐÒ³ÃæÌøת£¿
 
ÔõôʹÓÃjavascript½«Ò»¸öÒ³ÃæµÄÒ»¸ö²ÎÊý´«µÝµ½ÁíÍâÒ»¸öÒ³Ã棿
 
ʹÓô洢¹ý³Ì½øÐ ......

[android dev] How to create Menu @ JAVA & XML

to create Menu @ JAVA & XML ....
first, to tell you how to do. just to fill the following Method provided by Activity.
public boolean onCreateOptionsMenu(Menu menu)
public boolean onOptionsItemSelected(MenuItem item)
public boolean onPrepareOptionsMenu(Menu menu)
3 method above is simple to ......

Thinking in Javaѧϰ±Ê¼Ç£¨Ò»£©

ÔÚjava³ÌÐòÖУ¬ÍòÊÂÍòÎï½Ô¶ÔÏ󣬼´Ê¹ÊÇjava³ÌÐò±¾Éí£¬Ò²ÊÇÒ»¸ö¶ÔÏó
Ò»¡¢ReferenceÊDzÙ×ݶÔÏóÖ®Ô¿³×
             cÓïÑÔÖÐÊÇʹÓÃÖ¸ÕëÀ´²Ù×ݶÔÏóµÄ£¬µ«ÊÇjavaÄØ£¿ÓõÄÊÇreferenceÀ´²Ù×ݶÔÏó£¬ÎÒÏ°¹ß°ÑËû½Ð×ö¾ä±ú£¬¾ä±úºÍ¶ÔÏóµÄ¹Øϵ¾ÍÏëÊǵçÊÓÒ£¿ØÆ÷ºÍµçÊÓ»ú ......

JavaÈí¼þ¼Ü¹¹Ê¦ÐèÒªµÄ¶«Î÷

×÷ΪJava³ÌÐòÔ±À´Ëµ£¬×îÍ´¿àµÄÊÂÇéĪ¹ýÓÚ¿ÉÒÔÑ¡ÔñµÄ·¶Î§Ì«¹ã£¬¿ÉÒÔ¶ÁµÄÊéÌ«¶à£¬ÍùÍùÈÝÒ×ÎÞËùÊÊ´Ó¡£ÎÒÏë¾ÍÎÒ×Ô¼º¶Á¹ýµÄ¼¼ÊõÊé¼®ÖÐÌôÑ¡³öÀ´Ò»Ð©£¬°´ÕÕѧϰµÄÏȺó˳Ðò£¬ÍƼö¸ø´ó¼Ò£¬ÌرðÊÇÄÇЩÏë²»¶ÏÌá¸ß×Ô¼º¼¼ÊõˮƽµÄJava³ÌÐòÔ±ÃÇ¡£
Ò»¡¢Java±à³ÌÈëÃÅÀà
¶ÔÓÚûÓÐJava±à³Ì¾­ÑéµÄ³ÌÐòÔ±ÒªÈëÃÅ£¬Ëæ±ã¶ÁʲôÈëÃÅÊé¼®¶¼Ò»Ñù£¬Õâ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ