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

ɵB×Ô¼º¿´µÄjava±Ê¼Ç£º½âÎöXML

 ½ñÍíÁÄÁËÒ»ÍíÌ죬±ß¿´java ±ßÁÄÌ죬ûÓм¯Öо«ÉñÈ¥¿´¡£Ã»¸ã¶®java¶ÁÈ¡xml µÄ»úÖÆ¡£¿´ÁËһЩÊéÏÈ°ÑËû¼Ç¼һÏ¡£²ÉÓÃDOMÎĵµ¶ÔÏóÄ£ÐÍ£¬µÚÒ»ÖÖ·½·¨À´½âÎö¡£Ìý˵ÕâÖÖ½âÎö»áÓÐһЩȱµã£¬²»¹ý×ÜËãµ÷ÊÔͨÁË£¬ËãÊÇÒ»ÖÖ½ø²½¡£
<?xml version="1.0" encoding="utf-8"?>
<item>
  <node>aa</node>
  <node>bb</node>
</item>
´úÂëÁÐ±í¡£
import java.io.*;
import java.util.*;
import org.w3c.dom.*;
import javax.xml.parsers.*;
public class HelloWorld
{
public static void main(String arge[]) throws Exception
{
File f=new File("test.xml"); //Îļþ¼ÓÔØxml
DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
DocumentBuilder builder=factory.newDocumentBuilder();
Document doc = builder.parse(f);
NodeList node = doc.getElementsByTagName("node");//
System.out.print( doc.getElementsByTagName("node").item(1).getFirstChild().getNodeValue());
}
}



Ïà¹ØÎĵµ£º

Ïê½âJava½âÎöXMLµÄËÄÖÖ·½·¨


XMLÏÖÔÚÒѾ­³ÉΪһÖÖͨÓõÄÊý¾Ý½»»»¸ñʽ,ƽ̨µÄÎÞ¹ØÐÔʹµÃºÜ¶à³¡ºÏ¶¼ÐèÒªÓõ½XML¡£±¾ÎĽ«Ïêϸ½éÉÜÓÃJava½âÎöXMLµÄËÄÖÖ·½·¨¡£
XMLÏÖÔÚÒѾ­³ÉΪһÖÖͨÓõÄÊý¾Ý½»»»¸ñʽ,ËüµÄƽ̨ÎÞ¹ØÐÔ,ÓïÑÔÎÞ¹ØÐÔ,ϵͳÎÞ¹ØÐÔ,¸øÊý¾Ý¼¯³ÉÓë½»»¥´øÀ´Á˼«´óµÄ·½±ã¡£¶ÔÓÚXML±¾ÉíµÄÓ﷨֪ʶÓë¼¼Êõϸ½Ú,ÐèÒªÔĶÁÏà¹ØµÄ¼¼ÊõÎÄÏ×,ÕâÀïÃæ°üÀ¨µÄÄÚÈÝ ......

java³ÌÐòÈçºÎÉú³ÉjarÎļþ

Á½²½×ß:
1.java¹¤³Ì´ò°ü³ÉJarÎļþ(ȨÇÒµ±ÄãÊÇApp¹¤³ÌºÅÁË.)
   Õâ¸öºÃ°ì,ÔÚEclipseÖÐÓÒ¼üÑ¡ÔñÏîÄ¿ÉϵÄExport¹¦ÄÜ,ÔÚµ¼³öÀàÐÍÖÐÑ¡Ïîjar¼´¿É.
   ÔÚºóÐø½çÃæÉÏÓм¸¸öµØ·½ÐèҪעÒâµÄ.
   ¼ÇµÄ¹´Ñ¡"Export generated class files and resources". ÕâÑù¾Í»á°ÑÄãclasspathÖÐÒýÓõ½µÃµÚÈý·½ ......

Java DB ºÍ JDBC 4.0

http://developers.sun.com/javadb/
Java SE 6 ÐÂÌØÐÔ: Java DB ºÍ JDBC 4.0
http://www.ibm.com/developerworks/cn/java/j-lo-jse65/
³¤¾ÃÒÔÀ´£¬ÓÉÓÚ´óÁ¿£¨ÉõÖÁ¼¸ºõËùÓУ©µÄ Java Ó¦Óö¼ÒÀÀµÓÚÊý¾Ý¿â£¬ÈçºÎʹÓà Java ÓïÑÔ¸ßЧ¡¢¿É¿¿¡¢¼ò½àµØ·ÃÎÊÊý¾Ý¿âÒ»Ö±ÊdzÌÐòÔ±Ãǽò½òÀÖµÀµÄ»°Ì⡣з¢²¼µÄ Java SE 6 Ò²ÔÚÕâ·½Ãæ¸üÉ ......

javaÈÕÆÚ

Date ---->String
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String date = sdf.fomat(new Date());

String ---->Date
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse("2010-03-16");

ÈÕÆڱȽϴóС£¬Õâ¾ÍÓõ½ÁËDateÀàÖеÄbefore()ºÍafter()·½· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ