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

javaÓÅ»¯Õ¼ÓÃÄÚ´æµÄ·½·¨(¶þ)


À¬»øÊÕ¼¯¼¸ºõÊÇÿ¸ö¿ª·¢ÈËÔ±¶¼Ï²°®µÄÒ»¸ö Java™ ƽ̨ÌØÐÔ£¬Ëü¼ò»¯ÁË¿ª·¢£¬Ïû³ýÁËËùÓÐÖÖÀàµÄDZÔÚ´úÂë´íÎ󡣿ɾ¡¹ÜÀ¬»øÊÕ¼¯Ò»°ãÀ´Ëµ¿ÉÒÔÈÃÄúÎÞÐè½øÐÐ×ÊÔ´¹ÜÀí£¬ÓÐʱºòÄú»¹ÊDZØÐë×Ô¼º½øÐÐһЩÄÚÎñ´¦Àí¡£
ÏÔʽµØÊÍ·Å×ÊÔ´
Java ³ÌÐòÖÐʹÓõľø´ó¶àÊý×ÊÔ´¶¼ÊǶÔÏó£¬À¬»øÊÕ¼¯ÔÚÇåÀí¶ÔÏó·½Ãæ×öµÃºÜºÃ¡£Òò´Ë£¬Äú¿ÉÒÔʹÓÃÈÎÒâ¶àµÄ String¡£À¬»øÊÕ¼¯Æ÷×îÖÕÎÞÐèÄúµÄ¸ÉÔ¤¾Í»áËã³öËüÃǺÎʱʧЧ£¬²¢ÊÕ»ØËüÃÇʹÓõÄÄÚ´æ¡£
ÁíÒ»·½Ã棬ÏñÎļþ¾ä±úºÍÌ×½Ó×Ö¾ä±úÕâÀà·ÇÄÚ´æ×ÊÔ´±ØÐëÓɳÌÐòÏÔʽµØÊÍ·Å£¬±ÈÈçʹÓà close()¡¢destroy()¡¢shutdown() »ò release() ÕâÑùµÄ·½·¨À´ÊÍ·Å¡£ÓÐЩÀ࣬±ÈÈçƽ̨Àà¿âÖеÄÎļþ¾ä±úÁ÷ʵÏÖ£¬ÌṩÖÕ½áÆ÷£¨finalizer£©×÷Ϊ°²È«±£Ö¤£¬ÒԱ㵱À¬»øÊÕ¼¯Æ÷È·¶¨³ÌÐò²»ÔÙʹÓÃ×ÊÔ´¶ø³ÌÐòÈ´ÍüÁËÊÍ·Å×ÊԴʱ£¬ÖÕ½áÆ÷»¹¿ÉÒÔÀ´×öÕâ¸öÊͷŹ¤×÷¡£µ«ÊǾ¡¹ÜÎļþ¾ä±úÌṩÁËÖÕ½áÆ÷À´ÔÚÄúÍü¼ÇÁËʱΪÄúÊÍ·Å×ÊÔ´£¬×îºÃ»¹ÊÇÔÚʹÓÃÍêÖ®ºóÏÔʽµØÊÍ·Å×ÊÔ´¡£ÕâÑù×ö¿ÉÒÔ¸üÔçµØÊÍ·Å×ÊÔ´£¬½µµÍÁË×ÊÔ´ºÄ¾¡µÄ¿ÉÄÜ¡£
¶ÔÓÚÓÐЩ×ÊÔ´À´Ëµ£¬Ò»Ö±µÈµ½Öսᣨfinalization£©ÊÍ·ÅËüÃÇÊDz»¿ÉÈ¡µÄ¡£¶ÔÓÚÖØÒªµÄ×ÊÔ´£¬±ÈÈçËø»ñÈ¡ºÍÐźÅÁ¿Ðí¿ÉÖ¤£¬Lock »ò Semaphore Ö±µ½ºÜÍí¶¼¿ÉÄܲ»»á±»À¬»øÊÕ¼¯µô¡£¶ÔÓÚÊý¾Ý¿âÁ¬½ÓÕâÑùµÄ×ÊÔ´£¬Èç¹ûÄúµÈ´ýÖսᣬÄÇô¿Ï¶¨»áÏûºÄÍê×ÊÔ´¡£Ðí¶àÊý¾Ý¿â·þÎñÆ÷¸ù¾ÝÐí¿ÉµÄÈÝÁ¿£¬Ö»½ÓÊÜÒ»¶¨ÊýÁ¿µÄÁ¬½Ó¡£Èç¹û·þÎñÆ÷Ó¦ÓóÌÐòΪÿ¸öÇëÇ󶼴ò¿ªÒ»¸öеÄÊý¾Ý¿âÁ¬½Ó£¬È»ºóÓÃÍêÖ®ºó¾Í²»¹ÜÁË£¬ÄÇôÊý¾Ý¿âԶԶδµ½ÖÕ½áÆ÷¹Ø±Õ²»ÔÙÐèÒªµÄÁ¬½Ó£¬¾Í»áµ½´ïËüµÄ×î¸ßÈÝÁ¿¡£
¶àÊý×ÊÔ´¶¼²»»á³ÖÐøÕû¸öÓ¦ÓóÌÐòµÄÉúÃüÖÜÆÚ£¬Ïà·´£¬ËüÃÇÖ»±»ÓÃÓÚÒ»¸ö»î¶¯µÄÉúÃüÖÜÆÚ¡£µ±Ó¦ÓóÌÐò´ò¿ªÒ»¸öÎļþ¾ä±ú¶ÁÈ¡ÎļþÒÔ´¦ÀíÎĵµÊ±£¬Ëüͨ³£¶ÁÈ¡Îļþºó¾Í²»ÔÙÐèÒªÎļþ¾ä±úÁË¡£
ÔÚ×î¼òµ¥µÄÇé¿öÏ£¬×ÊÔ´ÔÚͬһ¸ö·½·¨µ÷ÓÃÖб»»ñÈ¡¡¢Ê¹ÓúÍÊÍ·Å£¬´úÂëÈçÏÂËùʾ
Java´úÂë
//²»ÕýÈ·µØÔÚÒ»¸ö·½·¨ÖлñÈ¡¡¢Ê¹ÓúÍÊÍ·Å×ÊÔ´ —— ²»ÒªÕâÑù×ö   
public static Properties loadPropertiesBadly(String fileName)   
            throws IOException {   
        FileInputStream stream = new FileInputStream(fileName);   
       &nbs


Ïà¹ØÎĵµ£º

Effective Java ѧϰ±Ê¼Ç£¨£±£©

ͨ³£Çé¿öÏ£¬ÎÒÃÇÔÚдһ¸öÀàʱ£¬Ò»°ã»á¸³ÓèËüÒ»¸ö»ò¼¸¸öpublicµÄ¹¹Ô캯Êý£¬ÈÃÍⲿ³ÌÐòÄܹ»´´½¨¶ÔÏó.¡¡È»¶ø£¬ÔÚeffective¡¡java ÖУ¬´ÓÁíÒ»¸ö½Ç¶È¸æ½ëÎÒÃÇÔÚʹÓÃpublicµÄ¹¹Ô캯ÊýÇ°£¬ÏÈ¿¼ÂÇÓÃpublic µÄ¾²Ì¬º¯ÊýÀ´´´½¨¶ÔÏó.¡¡
ÆäÓŵãÈçÏ£º
£±.¡¡Ò»¸ö¾²Ì¬µÄ¹¤³§º¯Êý£¬¿ÉÒÔÈ¡²»Í¬µÄÃû×Ö.¡¡¶ø¹¹Ô캯ÊýµÄÃû×ÖÖ»ÄÜÓëÀàͬÃû.¡¡
......

java(Web)ÖÐÏà¶Ô·¾¶£¬¾ø¶Ô·¾¶ÎÊÌâ×ܽá

1.»ù±¾¸ÅÄîµÄÀí½â
¡¡¡¡¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺
C:\xyz\test.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸öURL¾ø¶Ô·¾¶¡£
¡¡¡¡Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄÏà¶Ô·¾¶£¨HTMLÖеÄÏà¶ÔĿ¼£©£¬ÀýÈ磺ÔÚSer ......

java³£ÓÃÀà blobFileBean

package com.whlongyi.sys.blob.bean;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
im ......

javaͼƬÑéÖ¤Âë

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;
import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.ServletOutpu ......

javaÓÅ»¯Õ¼ÓÃÄÚ´æµÄ·½·¨(Ò»)

java×öµÄϵͳ¸øÈ˵ÄÓ¡ÏóÊÇʲô£¿Õ¼Äڴ棡˵µÀÕâ¾ä»°¾Í»áÓÐN¶àÈËÕ¾³öÀ´Îªjava±ç»¤£¬²¢¾Ù³öÒ»¶ÑµÄÐÔÄܲâÊÔ±¨¸æÀ´Ö¤Ã÷ÕâÒ»µã¡£Æäʵ´ÓÀíÂÛÉÏÀ´½²java×öµÄϵͳ²¢²»±ÈÆäËûÓïÑÔ¿ª·¢³öÀ´µÄϵͳ¸üÕ¼ÓÃÄڴ棬ÄÇôΪʲôȴÓÐÕâôN¶àÀíÓÉÀ´Ö¤Ã÷ËüȷʵռÄÚ´æÄØ£¿Á½¸ö×Ö£¬ÂªÏ°¡£
£¨1£©±ðÓÃnew Boolean()¡£
Ôںܶೡ¾°ÖÐBooleanÀàÐÍÊDZØÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ