JAVA¶ÁÈ¡PropertiesÎļþµÄÁùÖÖ·½·¨
ʹÓÃJ2SEAPI¶ÁÈ¡PropertiesÎļþµÄÁùÖÖ·½·¨
¡¡¡¡1¡£Ê¹ÓÃjava.util.PropertiesÀàµÄload()·½·¨Ê¾Àý£ºInputStream in=lnew BufferedInputStream(new FileInputStream(name));
properties p=newProperties(); p.load(in);
¡¡¡¡2¡£Ê¹ÓÃjava.util.ResourceBundleÀàµÄgetBundle()·½·¨Ê¾Àý£ºResourceBundle rb=ResourceBundle.getBundle
(name,Locale.getDefault());
¡¡¡¡3¡£Ê¹ÓÃjava.util.PropertyResourceBundleÀàµÄ¹¹Ô캯ÊýʾÀý£ºInputStream in=new BufferedInputStream(new FileInputStream
(name));ResourceBundle rb=newPropertyResourceBundle(in);
¡¡¡¡4¡£Ê¹ÓÃclass±äÁ¿µÄgetResourceAsStream()·½·¨Ê¾Àý£ºInputStream in=JProperties.class.getResourceAsStream(name);
properties p=newProperties(); p.load(in);
¡¡¡¡5¡£Ê¹ÓÃclass.getClassLoader()ËùµÃµ½µÄjava.lang.ClassLoaderµÄgetResourceAsStream()·½·¨Ê¾Àý£ºInputStream
in=JProperties.class.getClassLoader().getResourceAsStream(name); properties p=newProperties(); p.load(in);
¡¡¡¡6¡£Ê¹ÓÃjava.lang.ClassLoaderÀàµÄgetSystemResourceAsStream()¾²Ì¬·½·¨Ê¾Àý£ºInputStream
in=ClassLoader.getSystemResourceAsStream(name); properties p=newProperties(); p.load(in);
¡¡¡¡²¹³ä
¡¡¡¡ServletÖпÉÒÔʹÓÃjavax.servlet.ServletContextµÄgetResourceAsStream()·½·¨Ê¾Àý£ºInputStream
in=context.getResourceAsStream(path); properties p=newProperties(); p.load(in);
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔǰ£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
//1.´´½¨testdll.javaÎļþ
public class testdll
{
static
{
System.loadLibrary("goodluck");
}
public native static int get();
public native static void set(int i);
public static void main(String[] args)
{
testdll test = new testdll();
test.set(10);
System.out.println(test.get() ......
//»ñÈ¡Êý¾Ý¿âÊý¾Ý·µ»Ølist
public List queryAll(int fcateId) {
List list = new ArrayList();
String sql = "select * from g_Account where fCateID=? order by fCode";
Connection con = SqlHelp.getConn();//»ñµÃÁ¬½Ó£¬sqlhelp×Ô¼ºÐ´µÄ¹¤¾ßÀà
PreparedStatement pst = null;
ResultSet rs = null;
......
(1) transient:
Èç¹ûÓÃtransientÉùÃ÷Ò»¸öʵÀý±äÁ¿£¬µ±¶ÔÏó´æ´¢Ê±£¬ËüµÄÖµ²»ÐèҪά³Ö¡£ÀýÈ磺
class T
{
transient int a; //²»ÐèҪά³Ö
int b; //ÐèҪά³Ö
} //ÕâÀÈç¹ûTÀàµÄÒ»¸ö¶ÔÏóдÈëÒ»¸ö³Ö¾ÃµÄ´æ´¢ÇøÓò£¬aµ ......
ʹÓà Java ¶Ô Linux ÏÂÎļþ±àÂë¸ñʽ½øÐÐÅúÁ¿×ª»»
²âÊÔʹÓÃ˵Ã÷£º
1¡£½« ×Ö·û¼¯±àÂë¸ñʽΪ GB2312 µÄÎļþ test0.java£¬test1.java£¬test2.java ·ÅÔÚ /home/defonds/tmp/test Ŀ¼Ï£¨test0.java£¬test1.java£¬test2.java ×÷Õß¿ÉÒÔ ......