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

JavaỊ̈߳ºÏ̵߳Äͬ²½ÓëËø

JavaỊ̈߳ºÏ̵߳Äͬ²½ÓëËø
 
 
 
Ò»¡¢Í¬²½ÎÊÌâÌá³ö
 
Ï̵߳Äͬ²½ÊÇΪÁË·ÀÖ¹¶à¸öÏ̷߳ÃÎÊÒ»¸öÊý¾Ý¶ÔÏóʱ£¬¶ÔÊý¾ÝÔì³ÉµÄÆÆ»µ¡£
ÀýÈ磺Á½¸öÏß³ÌThreadA¡¢ThreadB¶¼²Ù×÷ͬһ¸ö¶ÔÏóFoo¶ÔÏ󣬲¢ÐÞ¸ÄFoo¶ÔÏóÉϵÄÊý¾Ý¡£
 
public class Foo {
    private int x = 100;
    public int getX() {
        return x;
    }
    public int fix(int y) {
        x = x - y;
        return x;
    }
}
 
public class MyRunnable implements Runnable {
    private Foo foo = new Foo();
    public static void main(String[] args) {
        MyRunnable r = new MyRunnable();
        Thread ta = new Thread(r, "Thread-A");
        Thread tb = new Thread(r, "Thread-B");
        ta.start();
        tb.start();
    }
    public void run() {
        for (int i = 0; i < 3; i++) {
            this.fix(30);
            try {
                Thread.sleep(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
         &nb


Ïà¹ØÎĵµ£º

javaÖÐÈçºÎʵÏÖÎļþ´ò°üÉÏ´«ÒÔ¼°×Ô¶¯½âѹ


ÎÒÃÇÔÚ¿ª·¢ÏîÄ¿µÄʱºò,ÌرðÊÇB/Sϵͳ,¾­³£»áÓöµ½ÒªÅúÁ¿ÉÏ´«ÎļþµÄÐèÇó,¶Ô´ËÐèÇóÒ»°ãÓÐÈçϼ¸¸ö½â¾ö·½°¸(ÒÔB/SΪÀý):
1. ÔÚ¿Í»§¶ËÌṩÎļþÉÏ´«½Ó¿Ú,Ò»´ÎÉÏ´«Ò»¸öÎļþ
2. Ò»´ÎÉÏ´«¶à¸öÎļþ
3. ½«ÐèÒªÉÏ´«µÄÎļþ´ò°ü,Ò»´ÎÉÏ´«µ½·þÎñÆ÷,²¢×Ô¶¯½âѹµ½Ö¸¶¨Ä¿Â¼
1,2·½·¨¶¼Óм¸¸öºÜÃ÷ÏԵIJ»×ã,Óû§¹¤×÷Á¿´ó,ÎļþÈç¹û¹ý´ó,ÔÚÍø ......

JavaÄÚ²¿ÀàµÄ×÷ÓÃ

Ò»¡¢ ¶¨Òå
·ÅÔÚÒ»¸öÀàµÄÄÚ²¿µÄÀàÎÒÃǾͽÐÄÚ²¿Àà¡£
¶þ¡¢ ×÷ÓÃ
1.ÄÚ²¿Àà¿ÉÒԺܺõÄʵÏÖÒþ²Ø,Ò²¾ÍÊÇ·â×°ÐÔ¡£Ò»°ãµÄ·ÇÄÚ²¿À࣬ÊDz»ÔÊÐíÓÐ private ÓëprotectedȨÏ޵ģ¬µ«ÄÚ²¿Àà¿ÉÒÔ
2.ÄÚ²¿ÀàÓµÓÐÍâΧÀàµÄËùÓÐÔªËصķÃÎÊȨÏÞ
3.¿ÉÊÇʵÏÖ¶àÖؼ̳Ð
4.¿ÉÒÔ±ÜÃâÐ޸ĽӿڶøʵÏÖͬһ¸öÀàÖÐÁ½ÖÖͬÃû·½·¨µÄµ÷ÓÃ
 
Èý¡¢  ......

javaʹÓÃPOI²Ù×÷Excel±¨±í

HSSFWorkbook API£ºhttp://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.html
office°ì¹«Èí¼þµÄʹÓÃʹµÃ¿ª·¢ÆóÒµ°ì¹«ÏµÍ³ÖУ¬³£³£Óпͻ§ÕâÑù×ÓÒªÇó£ºÄãÒª°ÑÎÒÃǵı¨±íÖ±½ÓÓÃExcel´ò¿ª¡£»òÕßÊÇ£ºÎÒÃÇÒѾ­Ï°¹ßÓÃExcel´òÓ¡¡£ÕâÑù×ÓÈç¹ûÓÃ.net¿ª·¢ÊÇûÓÐÎÊÌâµÄ£¬µ«ÊÇÓÐj2eeÕâ¸ö±È.net¸üÓÐǰ;µÄ¿ª·Åʽµ ......

Java¶àÏ̱߳à³Ì×ܽá

Java¶àÏ̱߳à³Ì×ܽá
 
ÏÂÃæÊÇJavaÏß³ÌϵÁв©ÎĵÄÒ»¸ö±àÄ¿£º
 
JavaỊ̈߳º¸ÅÄîÓëÔ­Àí
JavaỊ̈߳º´´½¨ÓëÆô¶¯
JavaỊ̈߳ºÏß³ÌջģÐÍÓëÏ̵߳ıäÁ¿
JavaỊ̈߳ºÏß³Ì״̬µÄת»»
JavaỊ̈߳ºÏ̵߳Äͬ²½ÓëËø
JavaỊ̈߳ºÏ̵߳Ľ»»¥
JavaỊ̈߳ºÏ̵߳ĵ÷¶È-ÐÝÃß
JavaỊ̈߳ºÏ̵߳ĵ÷¶È-ÓÅÏȼ¶
JavaỊ̈߳ºÏß ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ