»ñÈ¡java ÀàµÄ·¾¶
public class Path {
//get class absolute address
public String getPath() {
String classPath = getClass().getName();
if (classPath.indexOf(".") != -1) {
classPath = classPath.substring(classPath.lastIndexOf(".") + 1,
classPath.length());
}
classPath = getClass().getResource(classPath + ".class").toString();
classPath = classPath.substring(classPath.indexOf('/') + 1, classPath
.lastIndexOf('/')+1);
return classPath;
}
public static void main(String[] args)
{
System.out.println(new Path().getPath());
}
}
Ïà¹ØÎĵµ£º
ÏÂÃæÊdz£Óô¦ÀíÈÕÆڵķ½·¨£¬Ï£Íû¶Ô´ó¼ÒÓÐÓã¡
ÔÚÎÒ ......
xmlÎļþ£º
Xml´úÂë
<?xml version="1.0" encoding="GB2312"?>
<RESULT>
<VALUE>¡¡¡¡
<NO>A1234</NO>¡¡¡¡
<ADDR>ºÓÄÏÊ¡Ö£ÖÝÊÐ</ADDR>
</VALUE>&nbs ......
Ò».javaÀà
package com.java.test;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import java.io.*;
public class JavaReadXml {
// Document¿ÉÒÔ¿´×÷ÊÇXMLÔÚÄÚ´æÖеÄÒ»¸ ......
×î½üѧϰÖÐ×ÜÊǸоõÍ£Ö¹²»Ç°ÁË£¬µ½´ïÒ»¸öÆ¿¾±£¬¾³£Ð´µ½Ò»¸öµØ·½»á¾õµÃÕâ¸ö¶«Î÷ѧ¹ýµ«Óв»ÊÇÄÇôµÄÇå³þ£¬Ò»ÖÖËƶ®·Ç¶®µÄ¸Ð¾õ£¬ËùÒÔ¾ö¶¨Õҵط½°ÑÿÌìËùѧϰµÄ»òÓÐÓõĶ«Î÷¼Ç¼ÏÂÀ´£¬½ñÌ쿪ʼÕâÀォÊÇÎҵļ¼Êõ¿â£¬ÎÒ»áÓëËùÓа®ºÃJAVAµÄÅóÓÑÒ»Æðѧϰ£¬Ò»Æð½ø²½¡£½ñÌìÊÇ¿ª²©µÚÒ»Ì죬ÕýºÃÔÚ¸´Ï°DAOÉè¼Æģʽ£¬¿´µ½Ò»Æ¬²»´íµÄ½²½â£ ......
¡¡1¡¢JavaÓïÑÔÊǼòµ¥µÄ¡£JavaÓïÑÔµÄÓï·¨ÓëCÓïÑÔºÍC++ÓïÑԺܽӽü£¬Ê¹µÃ´ó¶àÊý³ÌÐòÔ±ºÜÈÝÒ×ѧϰºÍʹÓÃJava¡£ÁíÒ»·½Ã棬Java¶ªÆúÁËC++ ÖкÜÉÙʹÓõġ¢ºÜÄÑÀí½âµÄ¡¢ÁîÈËÃÔ»óµÄÄÇЩÌØÐÔ£¬Èç²Ù×÷·ûÖØÔØ¡¢¶à¼Ì³Ð¡¢×Ô¶¯µÄÇ¿ÖÆÀàÐÍת»»¡£ÌرðµØ£¬JavaÓïÑÔ²»Ê¹ÓÃÖ¸Õ룬²¢ÌṩÁË×Ô¶¯µÄ·ÏÁÏÊÕ¼¯£¬Ê¹µÃ³ÌÐòÔ±²»±ØΪÄÚ´æ¹ÜÀí¶øµ£ÓÇ¡£
¡¡¡ ......