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

JAVA¶àÏß³Ì

package debug;import java.io.*;import java.lang.Thread;class MyThread extends Thread{  public int x = 0;  public void run(){    System.out.println(++x);  }}class R implements Runnable{  private int x = 0;  public void run(){    System.out.println(++x);  }}public class Test {  public static void main(String[] args) throws Exception{        for(int i=0;i<10;i++){      Thread t = new MyThread();      t.start();    }    Thread.sleep(10000);//ÈÃÉÏÃæµÄÏß³ÌÔËÐÐÍê³É    R r = new R();    for(int i=0;i<10;i++){      Thread t = new Thread(r);      t.start();    }  }}¡¡¡¡ÉÏÃæ10¸öÏ̶߳ÔÏó²úÉúµÄ10¸öÏß³ÌÔËÐÐʱ´òÓ¡ÁË10´Î1¡£ÏÂÃæ10¸öÏ̶߳ÔÏó²úÉúµÄ10¸öÏß³ÌÔËÐÐʱ´òÓ¡ÁË1µ½10¡£ÎÒÃÇ°ÑÏÂÃæµÄ10¸öÏ̳߳ÆΪͬһʵÀý(RunnableʵÀý)µÄ¶à¸öÏ̡߳£
¡¡¡¡Ï½ÚÎÒÃǽ«Ñо¿Ï̶߳ÔÏó·½·¨£¬»¹ÊÇÄǾ仰£¬Ò»°ãÎĵµÖпÉÒÔ¶Áµ½µÄÄÚÈÝÎÒ²»»á½éÉÜÌ«¶à
Çë´ó¼Ò×Ô¼ºÁ˽⡣
Ï̶߳ÔÏóµÄ¼¸¸öÖØÒªµÄ·½·¨
¡¡¡¡¾¡¹ÜÏ̶߳ÔÏóµÄ³£Ó÷½·¨¿ÉÒÔͨ¹ýAPIÎĵµÀ´Á˽â,µ«ÊÇÓкܶ෽·¨½ö½ö´ÓAPI˵Ã÷ÊÇÎÞ·¨ÏêϸÁ˽âµÄ¡£
¡¡¡¡±¾À´´òËãÓÃÒ»½ÚµÄƪ·ùÀ´°ÑÏ̷߳½·¨ÖÐһЩÖØÒªµÄ֪ʶ˵Íê,µ«ÕâÑùÏÂÀ´¹À¼ÆÒªºÜ³£µÄƪ·ù,¿ÉÄÜÒªÓúü¸½Ú²ÅÄÜ˵°ÑºÍÏ̷߳½·¨Ïà¹ØµÄһЩÖØÒªµÄ֪ʶ˵Íê¡£
¡¡¡¡Ê×ÏÈÎÒÃǽӻù´¡Æª(¶þ)À´ËµÃ÷start()·½·¨¡£
¡¡¡¡Ò»¸öÏ̶߳ÔÏóÉú³Éºó,Èç¹ûÒª²úÉúÒ»¸öÖ´ÐеÄÏß³Ì,¾ÍÒ»¶¨Òªµ÷ÓÃËüµÄstart()·½·¨.ÔÚ½éÉÜÕâ¸ö·½·¨Ê±²»µÃ²»Í¬Ê±ËµÃ÷run·½·¨.ÆäʵÏß³Ì¶Ô ÏóµÄrun·½·¨ÍêÈ«ÊÇÒ»¸ö½Ó¿Ú»Øµ÷·½·¨,ËüÊÇÄãÕâ¸öÏ̶߳ÔÏóÒªÍê³ÉµÄ¾ßÌåÂß¼­.¼òµ¥ËµÄãÒª×öʲô¾ÍÄãÔÚrunÖÐÍê³É,¶øÈçºÎ×ö,ʲôʱºò×ö¾Í²»ÐèÒªÄã¿ØÖÆ ÁË,ÄãÖ»Òªµ÷ÓÃstart()·½·¨,JVM¾Í»á¹ÜÀíÕâ¸öÏ̶߳ÔÏóÈÃËü²úÉúÒ»¸öÏ̲߳¢×¢²áµ½Ï̴߳¦ÀíϵͳÖС£
¡¡¡¡´Ó±íÃæÉÏ¿´,start()·½·¨µ÷ÓÃÁËrun()·½·¨,ÊÂʵÉÏ,start()·½·¨²¢Ã»ÓÐÖ±½Óµ÷ÓÃrun·½·¨.ÔÚJDK1.5ÒÔÇ° start()·½·¨ÊDZ¾µØ·½·¨,ËüÈçºÎ×îÖÕµ÷ÓÃrun·½·¨ÒѾ­²»ÊÇJAVA³ÌÐòÔ±ËùÄÜÁ˽âµÄ.¶øÔÚJDK1.5ÖÐ,Ô­À´µÄÄǸö±¾µØstart()·½·¨±» start0()´úÌæ,Áí¸öÒ»¸


Ïà¹ØÎĵµ£º

JavaËã·¨ Ö±½Ó²åÈëÅÅÐò

/**
     * Ö±½Ó²åÈëÅÅÐò,Ê×ÏȱȽÏa[n]Óëa[n-1]£¬ÔڱȽÏa[n]Óëa[n-2]
     * */
    public void sort0(double[] a){
        for(int i = 0; i < a.length -1; i ++){
           ......

»Ø¹ËJava±à³Ì˼Ïëƪ£¨¶þ£©

4¡¢Ïú»Ù¶ÔÏó JavaÖв»ÐèÒª³ÌÐòÔ±×Ô¼ºÈ¥Ïú»Ù¶ÔÏó£¬ÕâÊÇΪʲôÄØ£¿ ÔÚC++ÖУ¬¶ÔÓÚ±äÁ¿¼°¶ÔÏóÉúÃüÖÜÆÚµÄά»¤Õ¼¾ÝÁË´óÁ¿µÄ±à³Ìʱ¼ä£¬ÒòΪ³ÌÐòÔ±ÐèÒªÖªµÀ±äÁ¿´æ»îµÄʱ¼ä£¬ÒÔ±ãÔÚÓÃÍêÖ®ºóÄÜ°ÑËüÏú»Ù£¬²»È»»áÕ¼ÂúÄÚ´æ¿Õ¼ä£¬×èÈû³ÌÐò¡£Òò´ËJavaÔÚÉè¼Æʱ¶Å¾øÁËÕâÒ»ÎÊÌâ¡£ÄÇôJavaÊÇÔõô×öµÄÄØ£¬¿´ÏÂÃæµÄ½éÉÜ¡£ 4.1¡¢±äÁ¿×÷ÓÃÓò ×÷ÓÃÓ ......

java keytool °²È«Ö¤Êéѧϰ

keytoolÉú³ÉÖ¤Êé
ÑéÖ¤ÊÇ·ñÒÑ´´½¨¹ýͬÃûµÄÖ¤Êé
keytool -list -v -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit
ɾ³ýÒÑ´´½¨µÄÖ¤Êé
keytool -delete -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit
´´½¨Ö¤Êé
1.·þÎñ ......

JAVA±à³Ì¹æ·¶

1. Ó¦Ó÷¶Î§
±¾¹æ·¶Ó¦ÓÃÓÚ²ÉÓÃJ2EE¹æ·¶µÄÏîÄ¿ÖУ¬ËùÓÐÏîÄ¿ÖеÄJAVA´úÂ루º¬JSP£¬SERVLET£¬JAVABEAN£¬EJB£©¾ùÓ¦×ñÊØÕâ¸ö¹æ·¶¡£Í¬Ê±£¬Ò²¿É×÷ΪÆäËüÏîÄ¿µÄ²Î¿¼¡£
2. Éè¼ÆÀàºÍ·½·¨
2.1     ´´½¨¾ßÓкÜÇ¿ÄÚ¾ÛÁ¦µÄÀà
·½·¨µÄÖØÒªÐÔÍùÍù±ÈÀàµÄÖØÒªÐÔ¸üÈÝÒ×Àí½â£¬·½·¨ÊÇÖ¸Ö´ÐÐÒ»¸öͳһº¯ÊýµÄÒ»¶Î´úÂë¡£Àà³£± ......

java¶àÏß³ÌÀý×Ó

package debug;import java.io.*;import java.lang.Thread;class MyThread extends Thread{  public int x = 0;  public void run(){    System.out.println(++x);  }}class R implements Runnable{  private int x = 0;  public void run(){    System.out.printl ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ