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

JavaµÄ´úÀíģʽÀý×Ó

(1).  ´´½¨Ò»¸ö½Ó¿Ú, Òª´úÀíµÄÀàºÍ ´úÀíÀ඼½«¼Ì³ÐËü
package stone;
public interface Image {
    public void show();
}
(2). ´´½¨Òª±»´úÀíµÄÀà:
package stone;
public class BigImage implements Image {
    public BigImage() {
        try {
            Thread.sleep(3000);                      // Ä£Äâ´óͼƬҪÓó¤Ê±¼äÀ´¼ÓÔØ
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("loading big image ");
    }
    public void show() {
        System.out.println("show image");
    }
}
(3). ´´½¨´úÀíÀà
package stone;
public class TestProxy {
    public static void main(String[] args) {
        long start= System.currentTimeMillis();
        Image image= new ImageProxy(null);
        System.out.println("Load time:"+String.valueOf(System.currentTimeMillis()-start));
        image.show();
        System.out.println("Show time:"+String.valueOf(System.currentTimeMillis()-start));
    }
}
(4). ÔËÐвâÊÔÀà,²âÊÔ´úÀíģʽ:
package stone;
public class TestProxy {
    public static void main(String[] args) {
        long start= System.currentTimeMillis();
        Image image= new ImageProxy(null);
        System.out.println("Load time:"+String.valueOf(Syste


Ïà¹ØÎĵµ£º

javaÐéÄâ»ú

javaÐéÄâ»ú
¡¡¡¡µ«ÊÇ£¬javaÐéÄâ»úµÄ½¨Á¢ÐèÒªÕë¶Ô²»Í¬µÄÈíÓ²¼þƽ̨×öרÃŵÄʵÏÖ£¬¼ÈÒª¿¼ÂÇ´¦ÀíÆ÷µÄÐͺţ¬Ò²Òª¿¼ÂDzÙ×÷ϵͳµÄÖÖÀà¡£ÈçÏÂͼËùʾ£¬Ä¿Ç°ÔÚSPARC½á¹¹¡¢X86½á¹¹¡¢MIPSºÍPPCµÈǶÈëʽ´¦ÀíоƬÉÏ¡¢ÔÚUNIX¡¢Linux¡¢windowsºÍ²¿·Öʵʱ²Ù×÷ϵͳÉ϶¼ÓÐjavaÐéÄâ»úµÄʵÏÖ¡£ ......

ѧjavaµÃÕâÑùѧ£¬Ñ§Ï°¶«Î÷ȷʵҲµÃÕâÑù

Èí¼þ¿ª·¢Ö®Â·ÊdzäÂú¾£¼¬ÓëÌôս֮·,Ò²ÊdzäÂúÏ£Íû֮·¡£JavaѧϰҲÊÇÈç´Ë£¬Ã»Óнݾ¶¿É×ß¡£ÃÎÏëÏñ¡¶ÌìÁú°Ë²¿¡·ÖÐÐéÖñÒ»Ñù±»ÎÞÑÂ×Óõ®õ­¹à¶¥¶øÇáËÉ»ñµÃÒ»¼××Ó¹¦Á¦£¬ÊǺܲ»ÏÖʵµÄ¡£Ã¿ÌìÑöÌì´ó½Ð"ÌìÉñ°¡£¬Çë´Í¸øÎÒÒ»±¾¿û»¨±¦µä°É"£¬Êâ²»Öª¼´Ê¹Äã»ñµÃÁË¿û»¨±¦µä£¬³ýÁËÊÜ×Ô¹¬ÆäÉíÖ®¿àÍ⣬ÄãÒ²²»Ò»¶¨³ÉµÃÁË"¶«·½²»°Ü"£¬µ¹ÊdzÉ"Î÷·½Ê§ ......

¼òÒ×JAVA»ñÈ¡ÍøÒ³ÓÐЧÓÊÏäµØÖ·

//  ¼òÒ×JAVA»ñÈ¡ÍøÒ³ÓÐЧÓÊÏäµØÖ· ---by 77
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class solo7 {
 public static void main(String args[]){
   ......

android ÖÐjava±à³ÌµÄÒâÍâʼþ´¦Àí

     ²»¹ÜÄãÐŲ»ÐÅ£¬¼´Ê¹¶àôÊìÁ·±à³ÌµÄÈËÔ±ÔÚcodingµÄʱºò¶¼»á³öÏÖÒâÏë²»µ½µÄbug¡£ÔÚÉÏƪÎÄÕÂÖÐÎÒÔøÌáµ½£¬bugµÄÔì³ÉÊǶà¸ö·½ÃæµÄ×ۺϽá¹û£¬ÓÐЩbugÊÇ¿ÉÒÔÐÞ¸´µÄ£¬µ«ÊÇÓÐЩÂß¼­ÉϵÄbugÒªÐÞ¸´¿É²»ÊÇÄÇôÈÝÒ×µÄÊÂÇ飬¾ÍÏñÎÒÃÇ×ö´íÁËÒ»¼þÊÂÇ飬Èç¹û²»È¥´Ó¸ù±¾ÉϸÄÕý¾Í»á·¸¸ü´óµÄ´íÎóÒ»Ñù£¬ÓÐʱºòbugÒ²ÊÇÒ»¸ö»ýÀ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ