Java SE ¶àÏß³Ì Ïß³ÌÉúÃüÖÜÆÚ
package thread;
class ThreadTest4 implements Runnable{
private boolean flag=true;
public void stopMe(){
flag=false;
}
public void run() {
while (flag){
System.out.println(Thread.currentThread().getName()+" is running ");
}
}
}
public class ThreadLife {
public static void main(String[] args) {
ThreadTest4 tt4=new ThreadTest4();
new Thread(tt4).start();
for(int i=0;i<100;i++){
if(i==50)
tt4.stopMe();
System.out.println("i="+i+" "+Thread.currentThread().getName()+" is running ");
}
}
}
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
±ÈÈçjavaÖг£ÓõÄÔËËã·û
Ò» ·ûºÅ++ ,+,--,-
ÓÐʱÕâ¸ö·ûºÅÆ´´ÕÆðÀ´Ò²Óе㸴ÔÓ
±ÈÈçÕâÑùÒ»¸öÔËËãʽ
int i=3;
i+++i-i++-++i
+ -ÔËËã·ûµÄÓÅÏȼ¶ µÍÓÚ++£¬-- ÏÈÔËËã++£¬--
¿ÉÒÔ½«ÉÏÃæµÄʽ×Ó²ð¿ª
i++ + i - i++ - ++i
ÕâÑùÊDz»ÊÇÈÝÒ׶àÁË
ÏÈÀ´¸ö¼òµ¥µãµÄ
1 K++
int k=0;
System.out.println(K++)
System.o ......
E:\>javac -X
-Xlint ÆôÓý¨ÒéµÄ¾¯¸æ
-Xlint:{all,deprecation,unchecked,fallthrough,path,serial,finally,-deprecat ion
,-unchecked,-fallthrough,-path,-serial,-finally}ÆôÓûò½ûÓÃÌض¨µÄ¾¯¸æ
& ......
ÊìϤC++µÄÈ˶ÔÓÚÁ½¸ö×Ö·û´®±È½ÏµÄ´úÂëÒ»¶¨ºÜÁ˽⣺
(string1==string2)
µ«ÔÚjavaÖУ¬Õâ¸ö´úÂ뼴ʹÔÚÁ½¸ö×Ö·û´®ÍêÈ«ÏàͬµÄÇé¿öÏÂÒ²»á·µ»Øfalse
JavaÖбØÐëʹÓÃstring1.equals(string2)À´½øÐÐÅжÏ
²¹³ä
Èç¹û£º
string s1=new String("Hello");
string s2=new String("Hello");
Ôò(s1==s2)=false
Èç¹û£º
s ......
¿ÉÄÜ´ó¶àÊýJsp¿ª·¢Ô±ÔÚдÍê³ÌÐò²âÊÔͨ¹ýºó£¬²»Ì«»á¹Ø×¢JspÉú³ÉµÄJavaÎļþ£¬Æäʵ£¬Í¨¹ýJava´úÂ룬¸üÄÜÌåÏÖ³ÌÐò´úÂëµÄÕæÕýº¬Ò壬¶Ô½øÒ»²½Ñо¿³ÌÐò´úÂëµÄºǫ́ÔËÐÐÇé¿öÊǷdz£ÓаïÖúµÄ¡£ÀýÈ磬ÓÃJsp±àд´úÂëʱ£¬ÓÐʱºòÓÃ<%! %>£¬ÓÐʱºòÓÃ<% %>£¬¼Ó²»¼Ó¸Ð̾º ......