java ÔËËã·û
ÔÚËãÊõÔËËã·û²¿·Ö£¬ÐèÒªÌØ±ð×¢ÒâµÄÒ»¸öÓï·¨ÏÖÏóÊÇ“½úÉý”¡£½úÉýÖ¸µÍÓÚintµÄ3ÖÖÊý×ÖÀàÐÍ(byte¡¢shortºÍchar)½øÐÐËãÊõÔËËãºó£¬½á¹û»á×Ô¶¯ÌáÉý³ÉintÀàÐÍ¡£Ê¾Àý´úÂëÈçÏ£º
byte b1 = 10;
byte b2 = 20;
byte b3 = b1 + b2; //Óï·¨´íÎó£¬ÀàÐͲ»Æ¥Åä
int n = b1 + b2; //»òÕß byte b3 = (byte)(b1 + b2);
×îºó˵һÏÂ&&ºÍ&µÄÇø±ð£¬ÆäʵÔÚ½øÐÐÂß¼ÓëÔËËãʱ£¬¼È¿ÉÒÔʹÓÃ&&Ò²¿ÉÒÔʹÓÃ&£¬ÔÚ¹¦ÄÜÉϱ¾ÉíûÓÐÇø±ð¡£Á½ÕßÇø±ðµÄλÖÃÔÚ£¬¶ÔÓÚ&À´Ëµ£¬Èç¹û×ó²àÌõ¼þΪfalse£¬Ò²»á¼ÆËãÓÒ²àÌõ¼þµÄÖµ£¬¶ø¶ÔÓÚ&&À´Ëµ£¬Èç¹û×ó²àµÄÌõ¼þΪfalse£¬Ôò²»¼ÆËãÓÒ²àµÄÌõ¼þ£¬ÕâÖÖÏÖÏó±»³Æ×÷¶Ì·ÏÖÏó¡£
ʾÀý´úÂ룺
int n = -1;
boolean b1 = (n >= 0) && (n < 10);
boolean b2 = (n >= 0) & (n < 10);
Ôò¶ÔÓÚµÚ¶þÐдúÂëÀ´Ëµ£¬Á½¸öÌõ¼þ¶¼½«±»¼ÆË㣬¶ø¶ÔÓÚµÚÈýÐдúÂëÀ´Ëµ£¬ÒòΪn >= 0Õâ¸öÌõ¼þ²»³ÉÁ¢£¬Ôòn < 10¸ù±¾²»»á±»Ö´ÐС£µ±È»£¬Á½Õߵõ½µÄ×îÖÕ½á¹ûÊÇÒ»ÑùµÄ¡£
¶ÔÓÚÏÖÔڵĴúÂëÀ´Ëµ£¬Çø±ð²»´ó£¬µ«ÊÇÈç¹ûºóÐøµÄÌõ¼þÊÇÒ»¸ö·½·¨(·½·¨µÄ¸ÅÄîºóÐø½«½éÉܵ½)£¬Ôò½«Ó°Ïì³ÌÐòÂß¼¡£
ÓÉÓÚ¼ÆËã»úÄÚ²¿µÄÊý¾Ý¶¼ÒÔ¶þ½øÖƵÄÐÎʽ´æÔ
Ïà¹ØÎĵµ£º
package com.allywll.core.exec.base;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent. ......
1¡¢Collection ºÍ CollectionsµÄÇø±ð¡£
CollectionsÊǸöjava.utilϵÄÀ࣬Ëü°üº¬Óи÷ÖÖÓйØjava¼¯ºÏ²Ù×÷µÄ¾²Ì¬·½·¨¡£
CollectionÊǸöjava.utilϵĽӿڣ¬ËüÊǸ÷ÖÖjava¼¯ºÏ½á¹¹µÄ¸¸½Ó¿Ú
2¡¢List, Set, MapÊÇ·ñ¼Ì³Ð×ÔCollection½Ó¿Ú? List£¬SetÊÇ Map²»ÊÇ
3¡¢ArrayListºÍVectorµÄÇø±ð¡£
(1).ͬ²½ÐÔ:VectorÊÇÏß³Ì ......
package thread;
public class ThreadTest {
public static void main(String args[])
{
//new TestThread ().start();
TestThread tt= new TestThread();//´´½¨TestThreadÀàµÄÒ»¸öʵÀý
Thread t= new Thread(tt);//´´½¨Ò»¸öThreadÀàµÄʵÀý
t.start();//ʹÏ߳̽øÈëRunnable״̬
new Thread(tt).star ......
²»¹ÜÄãÊÇÐÂÊÖ»¹ÊÇÀÏÄñ£¬ÔÚ³ÌÐòÖжÁÈ¡×ÊÔ´Îļþ×Ü»áÓöµ½Ò»Ð©ÕÒ²»µ½ÎļþµÄÎÊÌ⣬ÕâÓëJavaµ×²ãµÄʵÏÖÓйأ¬²»ÄÜËãbug£¬Ö»Òª·½·¨µÃµ±£¬ÎÊÌ⻹ÊÇ¿ÉÒÔ½â¾öµÄ¡£
ÏîÄ¿µÄÎļþ¼Ð½á¹¹£º
repathtest
©À©¤src
©¦ ©¸©¤com
©¦ &nb ......
java ´úÂë
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList; ......