¡¶Effective javaÖÐÎĵÚ2°æ¡·¶ÁÊé±Ê¼Ç1
µÚ2Ìõ£ºÓöµ½¶à¸ö¹¹ÔìÆ÷²ÎÊýʱҪ¿¼ÂÇÓù¹½¨Æ÷
ij¸öÀàµÄÊôÐԽ϶࣬³õʼ»¯µÄʱºòÓÖÓÐһЩÊDZØÐë³õʼ»¯µÄ£¬¶øÇÒÀàÐÍÓÐÐÎͬ£¬
±ÈÈçnew Contact("ÐÕÃû","ÏÔʾÃû","ÊÖ»úºÅ","·ÉÐźÅ","ËùÔÚµØ",ÄêÁä,ÐÔ±ð);
Ç°5¸öÊôÐÔÊÇString ÀàÐÍ£¬ºó2¸öÊÇintÀàÐÍ£¬ÔÚÌîд¹¹Ôì·½·¨µÄʱºòºÜÈÝÒ×Ìîд´í룬»òÕßÉÙÌîд£¬»òÕߵߵ¹ÁËÊôÐÔ£¬
ÈçÏ·½·¨¿ÉÒÔ¼õÉÙÕâÖÖ´íÎó·¢ÉúµÄ¼¸ÂÊ£¬
Contact contact = new Contact();
contact.setName("ÐÕÃû");
contact.setDisplayName("ÏÔʾÃû");
contact.setPhoneNumber("ÊÖ»úºÅ");
contact.setFetionNumber("·ÉÐźÅ");
contact.setHometown("ËùÔÚµØ");
contact.setAge(23);
contact.setGender(0);
ÕâôдÊÇͨ³£µÄ×ö·¨£¬¿´ÆðÀ´»¹²»¹»ÇåÎú£¬ÎÒÃÇÔÚÿ¸öset·½·¨ÀïretrunÒ»¸öContactÀàÐÍ£¬±ÈÈç
public Contact setName(String name)
{
this.name = name;
return this;
}
ÕâÑùÉÏÃæµÄ¹¹ÔìContactµÄ´úÂë¾Í¿ÉÒÔÕâôдÁË
Contact contact = new Contact() .setName("ÐÕÃû")
.setDisplayName("ÏÔʾÃû")
.setPhoneNumber("ÊÖ»úºÅ")
.setFetionNumber("·ÉÐźÅ")
.setHometown("ËùÔÚµØ")
.setAge(23)
.setGender(0);
ÕâÑùдÊDz»ÊǸüÇåˬÁË£¡ÊôÐÔ²»»áÔÙÌîд´íÎóÁË£¡¶øÇÒÔĶÁ´úÂëµÄʱºòҲһĿÁËÈ»£¬¶¼¸øContact³õʼ»¯ÁËÄÇЩÊôÐÔ£¬ºÍÊôÐÔµÄÖµÊÇʲô£¡
µÚ3Ìõ£ºÓÃ˽Óй¹ÔìÆ÷»òÕßö¾ÙÀàÐÍÇ¿»¯SingletonÊôÐÔ
½¨ÒéʹÓÃÈçÏ·½·¨´´½¨µ¥ÀýÀà
public final class Elvis
{
private static Elvis INSTANCE;
private Elvis(){};
synchronized public static Elvis getInstance()
{
if( INSTANCE == null )
{
INSTANCE = new Elvis();
}
return INSTANCE;
}
//Ö´ÐÐÆäËû²Ù×÷
private Object readResolve()
{
return INSTANCE;
}
}
ÕâÖÖ¹¹½¨·½·¨ºÃ´¦£¬×é³ÉÀàµÄ³ÉÔ±ÉùÃ÷ºÜÇå³þµØ±íÃ÷ÁËÕâ¸öÀàÊǸöSingleton£¬²¢ÇÒÒ²½â¾öÁËINSTANCEµÄͬ²½ÎÊÌ⣬
ûÓб©Â¶¹²ÓеÄINSTANCE±äÁ¿£¬ÕâÑù¸üÓÐÁ¦ÓÚÒþ²ØÀàµÄÄÚ²¿ÊµÏÖ£¬
ÁíÍ⣬¸Ä×ö·¨Ò²ºÜÈÝÒ׾ͿÉÒÔÐ޸ijɷǵ¥Àýģʽ£¬¼ÓÉϵÄreadResolve·½·¨¿ÉÒÔ±£Ö¤·´ÐòÁл¯Ê±Ò²ÊÇͬһ¸ö¶ÔÏó¡£
µÚ4Ìõ£ºÍ¨¹ý˽Óй¹ÔìÆ÷Ç¿»¯²»¿ÉʵÀý»¯µÄÄÜÁ¦
ÎÒÃÇÈí¼þÖг£Óõij£Á¿¼¯(Constants)£¬¹¤¾ß¼¯(Tool,Utility)¶¼Ó¦¸ÃÊDz»¿ÉʵÀý»¯µÄÀ࣬ÄÇôËûÃÇÓ¦¸ÃÈçϹ¹½¨
public final class
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
Ñ¡ÔñÁËjava£¬Ò²¾ÍÊÇÑ¡ÔñÁËÒ»Ìõ¹âÃ÷¶ø¿²¿ÀµÄµÀ·¡£ËµËû¹âÃ÷ÊÇÒòΪӦÓõĵط½ÈÕÒæ¹ã·º£¬È«ÇòÓкܴóµÄ¿ª·¢ÈºÌåÔÚΪ֮æµ£¬¿ªÔ´ÏîÄ¿Ó¦Óо¡ÓУ»ËµËû¿²¿À£¬ÊÇÒòΪËæ×ÅjavaµÄ·¢Õ¹£¬ÏÖÔÚÓÐÁËÌ«¶àµÄ·ÖÖ§¼¼Êõj2ee 13ÖÖ¼¼Êõ£¬Ì«¶àµÄ¿ò¼Ü(´Óµ×²ãµ½Ò³Ãæ)Èç¹ûÒªÕÆÎÕ»¹Õæ²»ÊǼþÈÝÒ×µÄÊÂÇ飬¶øÇÒ¿ªÔ´µÄ¶«Î÷ÓÀÎÞÖ¹¾¡µÄÔÚÉý¼¶£¬ÔÚÍƳ ......
l JBS
1.Áоٳö 10¸öJAVAÓïÑÔµÄÓÅÊÆ
a:Ãâ·Ñ£¬¿ªÔ´£¬¿çƽ̨(ƽ̨¶ÀÁ¢ÐÔ)£¬¼òµ¥Ò×Ó㬹¦ÄÜÍêÉÆ£¬ÃæÏò¶ÔÏ󣬽¡×³ÐÔ£¬¶àỊ̈߳¬½á¹¹ÖÐÁ¢£¬ÆóÒµÓ¦ÓõijÉÊìƽ̨, ÎÞÏßÓ¦ÓÃ
2.ÁоٳöJAVAÖÐ10¸öÃæÏò¶ÔÏó±à³ÌµÄÊõÓï
a:°ü£¬À࣬½Ó¿Ú£¬¶ÔÏó£¬ÊôÐÔ£¬·½·¨£¬¹¹ÔìÆ÷£¬¼Ì³Ð£¬·â×°£¬¶à̬£¬³éÏ󣬷¶ÐÍ
3.ÁоٳöJAVAÖÐ6¸ ......
¹¤×÷ÐèÒª£¬Õë¶ÔjavaÎļþ£¬×÷ÁËÒ»¸öÐÐÊýͳ¼ÆµÄ¹¤¾ß¡£Í³¼ÆµÄÖ÷Òª´úÂëÈçÏ£º
Set srcIn = fso.OpenTextFile(fileNm, ForReading)
Do While Not srcIn.AtEndOfStream
buf = srcIn.ReadLine
&nbs ......
ÖÐÎĵıàÂë³£ÓõÄÓÐ3ÖÖ¸ñʽ£º1£©gb2312(¾ÍÊÇasciiÂ뷽ʽ£¬Ò²Ëµansi) 2)unicode 3)utf-8
c++Ò»°ã²ÉÓÃanciiÂ룬¶øjavaÒ»°ã²ÉÓÃunicode£¬¶øSymbianC++£¨ÒÔºó¼ò³Æsymbian£©²ÉÓÃunicode»òutf-8
±ÈÈ纺×Ö“ºÃ”£º unicodeΪ“7D 59”£¬¶øasciiΪ“BA C3”, utf-8±àÂëΪ3¸ö×Ö½Ú¡£
ÖÕ¶ËÄã ......