JAVA²Ù×÷XMLµÄÍêÕûÀý×Ó——W3C DOMƪ
ÕâÊÇÒ»¸öÓÃJAVA W3C DOM ½øÐÐXML²Ù×÷µÄÀý×Ó£¬°üº¬Á˲éѯ¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ý¡¢±£´æµÄ»ù±¾²Ù×÷¡£½ÏÍêÕûµÄÃèÊöÁËÒ»¸öXMLµÄÕû¸ö²Ù×÷Á÷³Ì¡£ÊʺϸÕÈëÃÅJAVA XML²Ù×÷µÄÅóÓѲο¼ºÍѧϰ¡£
¼ÙÉèÓÐXMLÎļþ£ºtest1.xml
<?xml version="1.0" encoding="UTF-8"?>
<books>
<book>
<name>¹þÀﲨÌØ</name>
<price>10</price>
<memo>ÕâÊÇÒ»±¾ºÜºÃ¿´µÄÊé¡£</memo>
</book>
<book id="B02">
<name>Èý¹úÑÝÒå</name>
<price>10</price>
<memo>ËÄ´óÃûÖøÖ®Ò»¡£</memo>
</book>
<book id="B03">
<name>Ë®ä°</name>
<price>6</price>
<memo>ËÄ´óÃûÖøÖ®Ò»¡£</memo>
</book>
<book id="B04">
<name>ºìÂ¥</name>
<price>5</price>
<memo>ËÄ´óÃûÖøÖ®Ò»¡£</memo>
</book>
</books>
ÏÂÃæÊÇΪTest.java
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.*;
import javax.xml.xpath.*;
public class Test ...{
public static void main(String[] args) ...{
DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
Element theBook=null, theElem=null, root=null;
try ...{
factory.setIgnoringElementContentWhitespace(true);
DocumentBuilder db=factory.newDocumentBuilder();
Ïà¹ØÎĵµ£º
²Ù×÷·û
1.λ²Ù×÷·û
(a) >>>ÓÒÒÆ£¬¸ßλÓÃ0Ìî³ä£»
int a = 14;
int b = 2;
System.out.println(a >>> b);// 3
int c = -14;
int d = 2;
System.out.println(c >>> d);// 1073741820
(b) >>·ûºÅλ²»±ä£¬ÆäËûλÓÒÒÆ£¬¸ßλÓÃ0Ìî³ä£¬Æä½á¹ûÓëa/2bÏàͬ£»
int a = 14;
int b = 2;
Sy ......
Ê×ÏȽ«dom4j-1.6.1.jar,jaxen-1.1.1.jarÁ½¸öjar°üµ¼Èëµ½ÏîÄ¿ÖÐ
reader_config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<db-info>
<driver-name>oracle.jdbc.driver.OracleDriver</driver-name>
<url>jdbc:oracle:thin:@192.168.1.100:1521:orcl</url>
......
ÔÌûÒ»£ºhttp://blog.csdn.net/dotphoenix/archive/2009/05/20/4203075.aspx
ÔÌù¶þ£ºhttp://www.cocoachina.com/bbs/read.php?tid-8008.html
@property (²ÎÊý) ÀàÐÍ Ãû×Ö;
ÕâÀïµÄ²ÎÊýÖ÷Òª·ÖΪÈýÀࣺ¶ÁдÊôÐÔ£¨readwrite/readonly£©£¬setterÓïÒ⣨assign/retain/copy£©ÒÔ¼°atomicity£¨nonatomic£©¡£
assign/retain/copy ......
×ÜÊDZ»Í¬Ñ§ÃÇÎʵ½£¬ÈçºÎѧϰCºÍC++²Å²»Ã£È»£¬²Å²»ÊÇÂÒѧ£¬ÏëÁËһϣ¬ÕâÀï¸ø³öÒ»¸ö×ܵĻظ´¡£
¡¡¡¡Ò»¼ÒÖ®ÑÔ£¬»¶ÓÅÄש¹þ¡£
¡¡¡¡1¡¢¿ÉÒÔ¿¼ÂÇÏÈѧϰC.
¡¡¡¡´ó¶àÊýʱºò£¬ÎÒÃÇѧϰÓïÑÔµÄÄ¿µÄ£¬²»ÊÇΪÁ˳ÉΪһ¸öÓïÑÔר¼Ò£¬¶øÊÇÏ£Íû³ÉΪһ¸ö½â¾öÎÊÌâµÄר¼Ò¡£×öÒ»¸öÓÐÓõijÌÐòÔ±£¬×öÒ»¸ö׬ǮµÄ³ÌÐòÔ±¡£ÎÒÃǵļ ......
Java¿ÉÒÔÖ±½Óµ÷ÓÃLinuxÃüÁÐÎʽÈçÏ£º
Runtime.getRuntime().exec(command)
¾ÙÀý£ºÔËÐÐls,topÃüÁî¿ÉÒÔÕâÑù£º
Runtime.getRuntime().exec("ls");
µ«ÊÇÕâÑùÖ´ÐÐʱûÓÐÈκÎÊä³ö£¬ÔÒò£º
µ÷ÓÃRuntime.exec·½·¨½«²úÉúÒ»¸ö±¾µØµÄ½ø³Ì,²¢·µ»ØÒ»¸öProcess×ÓÀàµÄʵÀý£¬
£¨×¢Ò⣺Runtim ......