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 ......
JAVA´úÂë±àÒëºóÊÇ.classÎļþ,ͨ¹ý·´±à¹¤¾ßºÜÈÝÒ×±»±ðÈË¿´µ½Ô´´úÂë
±£»¤JAVA´úÂëµÄ·½·¨ºÜ¶à£¬ÏÂÃæ½éÉÜÒ»ÖֱȽϷ½±ãʹÓõķ½·¨¡£
obfuscate4eÊÇÒ»¿î²ÉÓûìÏýÆ÷¸Ä±äCLASSÎļþÄÚÈݵķ½·¨¡£
ÏÂÎĽ«½éÉܾßÌåºÍeclipseµÄÕûºÏ·½·¨
1.ÏÂÔØobfuscate4e,¼ÓÈëÕ¾µãhttp://obfuscate4e.org/updates/,Õâ¸öÈí¼þÊǵ¹úÈË¿ª· ......
//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() ......
Reflection ÊÇJava±»ÊÓΪ¶¯Ì¬£¨»ò×¼¶¯Ì¬£©ÓïÑÔµÄÒ»¸ö¹Ø¼üÐÔÖÊ¡£Õâ¸ö»úÖÆÔÊÐí³ÌÐòÔÚÔËÐÐʱ͸¹ýReflection APIsÈ¡µÃÈκÎÒ»¸öÒÑÖªÃû³ÆµÄclass
µÄÄÚ²¿ÐÅÏ¢£¬°üÀ¨Æämodifiers£¨ÖîÈçpublic, static µÈµÈ£©¡¢superclass£¨ÀýÈçObject£©¡¢ÊµÏÖÖ®interfaces£¨ÀýÈçCloneable£©£¬Ò²°üÀ¨fields
ºÍmethodsµÄËùÓÐÐÅÏ ......