java±ÊÊÔ»ã×Ü£¨2£©
41¡¢ÊÇ·ñ¿ÉÒԼ̳ÐStringÀà?
StringÀàÊÇfinalÀà¹Ê²»¿ÉÒԼ̳С£
42¡¢swtichÊÇ·ñÄÜ×÷ÓÃÔÚbyteÉÏ£¬ÊÇ·ñÄÜ×÷ÓÃÔÚlongÉÏ£¬ÊÇ·ñÄÜ×÷ÓÃÔÚStringÉÏ?
switch£¨expr1£©ÖУ¬expr1ÊÇÒ»¸öÕûÊý±í´ïʽ¡£Òò´Ë´«µÝ¸ø switch ºÍ case Óï¾äµÄ²ÎÊýÓ¦¸ÃÊÇ int¡¢ short¡¢ char »òÕß byte¡£long,string ¶¼²»ÄÜ×÷ÓÃÓÚswtich¡£
43¡¢try {}ÀïÓÐÒ»¸öreturnÓï¾ä£¬ÄÇô½ô¸úÔÚÕâ¸ötryºóµÄfinally {}ÀïµÄcode»á²»»á±»Ö´ÐУ¬Ê²Ã´Ê±ºò±»Ö´ÐУ¬ÔÚreturnÇ°»¹ÊǺó?
»áÖ´ÐУ¬ÔÚreturnÇ°Ö´ÐС£
44¡¢±à³ÌÌâ: ÓÃ×îÓÐЧÂʵķ½·¨Ëã³ö2³ËÒÔ8µÈ춼¸?
2 << 3
45¡¢Á½¸ö¶ÔÏóÖµÏàͬ(x.equals(y) == true)£¬µ«È´¿ÉÓв»Í¬µÄhash code£¬Õâ¾ä»°¶Ô²»¶Ô?
²»¶Ô£¬ÓÐÏàͬµÄhash code¡£
46¡¢µ±Ò»¸ö¶ÔÏó±»µ±×÷²ÎÊý´«µÝµ½Ò»¸ö·½·¨ºó£¬´Ë·½·¨¿É¸Ä±äÕâ¸ö¶ÔÏóµÄÊôÐÔ£¬²¢¿É·µ»Ø±ä»¯ºóµÄ½á¹û£¬ÄÇôÕâÀïµ½µ×ÊÇÖµ´«µÝ»¹ÊÇÒýÓô«µÝ?
ÊÇÖµ´«µÝ¡£Java ±à³ÌÓïÑÔÖ»ÓÐÖµ´«µÝ²ÎÊý¡£µ±Ò»¸ö¶ÔÏóʵÀý×÷Ϊһ¸ö²ÎÊý±»´«µÝµ½·½·¨ÖÐʱ£¬²ÎÊýµÄÖµ¾ÍÊǶԸöÔÏóµÄÒýÓ᣶ÔÏóµÄÄÚÈÝ¿ÉÒÔÔÚ±»µ÷Óõķ½·¨Öиı䣬µ«¶ÔÏóµÄÒýÓÃÊÇÓÀÔ¶²»»á¸Ä±äµÄ¡£
47¡¢µ±Ò»¸öÏ߳̽øÈëÒ»¸ö¶ÔÏóµÄÒ»¸ösynchronized·½·¨ºó£¬ÆäËüÏß³ÌÊÇ·ñ¿É½øÈë´Ë¶ÔÏóµÄÆäËü·½·¨?
²»ÄÜ£¬Ò»¸ö¶ÔÏóµÄÒ»¸ösynchronized·½·¨Ö»ÄÜÓÉÒ»¸öÏ̷߳ÃÎÊ¡£
48¡¢±à³ÌÌâ: дһ¸öSingleton³öÀ´¡£
SingletonģʽÖ÷Òª×÷ÓÃÊDZ£Ö¤ÔÚJavaÓ¦ÓóÌÐòÖУ¬Ò»¸öÀàClassÖ»ÓÐÒ»¸öʵÀý´æÔÚ¡£
Ò»°ãSingletonģʽͨ³£Óм¸ÖÖÖÖÐÎʽ:
µÚÒ»ÖÖÐÎʽ: ¶¨ÒåÒ»¸öÀ࣬ËüµÄ¹¹Ô캯ÊýΪprivateµÄ£¬ËüÓÐÒ»¸östaticµÄprivateµÄ¸ÃÀà±äÁ¿£¬ÔÚÀà³õʼ»¯Ê±ÊµÀý»°£¬Í¨¹ýÒ»¸öpublicµÄgetInstance·½·¨»ñÈ¡¶ÔËüµÄÒýÓÃ,¼Ì¶øµ÷ÓÃÆäÖеķ½·¨¡£
public class Singleton {
private Singleton(){}
¡¡¡¡ //ÔÚ×Ô¼ºÄÚ²¿¶¨Òå×Ô¼ºÒ»¸öʵÀý£¬ÊDz»ÊǺÜÆæ¹Ö£¿
¡¡¡¡ //×¢ÒâÕâÊÇprivate Ö»¹©ÄÚ²¿µ÷ÓÃ
¡¡¡¡ private static Singleton instance = new Singleton();
¡¡¡¡ //ÕâÀïÌṩÁËÒ»¸ö¹©Íⲿ·ÃÎʱ¾classµÄ¾²Ì¬·½·¨£¬¿ÉÒÔÖ±½Ó·ÃÎÊ¡¡¡¡
¡¡¡¡ public static Singleton getInstance() {
¡¡¡¡¡¡¡¡&nb
Ïà¹ØÎĵµ£º
×î½ü×ö¸öÏîÄ¿£¬¾ÍÊÇҪȡµÃcpuÕ¼ÓÐÂʵȵȵÄϵͳÐÅÏ¢£¬Ò»¿ªÊ¼ÒÔΪҪÓö¯Ì¬Á´½Ó¿âÁË£¬µ«ºóÀ´·¢ÏÖ¿ÉÒÔÏñÏÂÃæÕâÑù×ö£¬²»È¥µ÷ÓÃjni£¬ÕâÑùÊ¡È¥Á˺ܶ࿴м¼ÊõµÄʱ¼äo(∩_∩)o...
ÔÚJavaÖУ¬¿ÉÒÔ»ñµÃ×ܵÄÎïÀíÄڴ桢ʣÓàµÄÎïÀíÄÚ´æ¡¢ÒÑʹÓõÄÎïÀíÄÚ´æµÈÐÅÏ¢£¬ÏÂÃæÀý×Ó¿ÉÒÔÈ¡µÃÕâЩÐÅÏ¢£¬²¢ÇÒ»ñµÃÔÚWindowsϵÄÄÚ´æʹÓà......
±ØÐëÓÃthis¹Ø¼ü×ÖµÄÈýÖÖÇé¿ö:
1.ÎÒÃÇÏëͨ¹ý¹¹Ôì·½·¨½«Íⲿ´«ÈëµÄ²ÎÊý¸³Öµ¸ø³ÉÔ±±äÁ¿,¶ø¹¹Ôì·½·¨µÄÐÎʽ²ÎÊýÓëÀà³ÉÔ±µÄ±äÁ¿ÃûÏàͬ,Õâʱ¾ÍÐèÒªthisÕâ¸ö¹Ø¼ü×ÖÀ´Çø±ð¾Ö²¿±äÁ¿ÓëÀà±äÁ¿;
2.¼ÙÉèÓÐÒ»¸öÈÝÆ÷ÀàºÍÒ»¸ö²¿¼þÀà,ÔÚÈÝÆ÷ÀàµÄij¸ö·½·¨ÖÐÒª´´½¨²¿¼þÀàµÄʵÀý¶ÔÏó,¶ø²¿¼þÀàµÄ¹¹Ôì·½·¨Òª½ÓÊÕÒ»¸ö´ú±íÆäËùÔÚÈÝÆ÷µÄ²ÎÊý,ÕâÊ±Ò²Ò ......
ÿ¸öJavaÓ¦Óö¼¿ÉÒÔÓÐ×Ô¼ºµÄ°²È«¹ÜÀíÆ÷£¬ËüÊÇ·À·¶¶ñÒâ¹¥»÷µÄÖ÷Òª°²È«ÎÀÊ¿¡£°²È«¹ÜÀíÆ÷ͨ¹ýÖ´ÐÐÔËÐн׶μì²éºÍ·ÃÎÊÊÚȨ£¬ÒÔʵʩӦÓÃËùÐèµÄ°²È«²ßÂÔ£¬´Ó¶ø±£»¤×ÊÔ´ÃâÊܶñÒâ²Ù×÷µÄ¹¥»÷¡£Êµ¼ÊÉÏ£¬°²È«¹ÜÀíÆ÷¸ù¾ÝJava°²È«²ßÂÔÎļþ¾ö¶¨½«ÄÄ×éȨÏÞÊÚÓèÀࡣȻ¶ø£¬µ±²»¿ÉÐŵÄÀàºÍµÚÈý·½Ó¦ÓÃʹÓÃJVMʱ£¬Java°²È«¹Ü ......
Ìõ¼þ£ºÒÑ°²×°J2SEºÍJ2EE¡£
Microsoft SQL Server 2000 Driver for JDBCÊÇ΢Èí¹«Ë¾Ãâ·ÑÌṩÃâ·ÑÏÂÔصÄÒ»¸öÈí¼þ£¬Çë·ÃÎÊ£º http://www.microsoft.com/sql/default.asp£¬ÏÂÔغóÎļþÃûΪ£ºsetup.exe£¬°²×°ºó£¬Ä¬ÈÏ·¾¶ÊÇ£º%Program Files%\Microsoft SQL Server 2000 Driver for JDBC£¬¸ÃĿ¼ÏÂLIBĿ¼ÀïÓÐ3¸öjarÎļþ¡£ ......
1.java¹ýÂËÆ÷¶ÔextÒì²½ÇëÇóÌøת
Óû§·ÃÎʳ¬Ê±
½â¾öÁ½ÖÖÇé¿öϵÄÓû§·ÃÎʳ¬Ê±¡£
a£©ÆÕͨhttpÇëÇóµÄsession³¬Ê±¡£
b£©Òì²½httpÇëÇóµÄsession³¬Ê±£¬Ê¹ÓÃextºó´ó²¿·ÖµÄ½çÃæˢж¼ÊÇÒì²½µÄajaxÇëÇó¡£
²»¹ÜÊÇÄÇÖÖÀàÐ͵ÄhttpÇëÇó×ÜÊÇ¿ÉÒÔÓÉÒ»¸ö¹ýÂËÆ÷À´²¶×½¡£
·ÖÀࣺÆÕͨhttpÇëÇóµÄheader²ÎÊýÖÐûÓÐx-requested-with: ......