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´úÂë±àÒëºóÊÇ.classÎļþ,ͨ¹ý·´±à¹¤¾ßºÜÈÝÒ×±»±ðÈË¿´µ½Ô´´úÂë
±£»¤JAVA´úÂëµÄ·½·¨ºÜ¶à£¬ÏÂÃæ½éÉÜÒ»ÖֱȽϷ½±ãʹÓõķ½·¨¡£
obfuscate4eÊÇÒ»¿î²ÉÓûìÏýÆ÷¸Ä±äCLASSÎļþÄÚÈݵķ½·¨¡£
ÏÂÎĽ«½éÉܾßÌåºÍeclipseµÄÕûºÏ·½·¨
1.ÏÂÔØobfuscate4e,¼ÓÈëÕ¾µãhttp://obfuscate4e.org/updates/,Õâ¸öÈí¼þÊǵ¹úÈË¿ª· ......
JavaÖеÄreturnÓï¾ä×ÜÊǺͷ½·¨ÓÐÃÜÇйØÏµ£¬returnÓï¾ä×ÜÊÇÓÃÔÚ·½·¨ÖУ¬ÓÐÁ½¸ö×÷Óã¬Ò»¸öÊÇ·µ»Ø·½·¨Ö¸¶¨ÀàÐ͵ÄÖµ(Õâ¸öÖµ×ÜÊÇÈ·¶¨µÄ)£¬Ò»¸öÊǽáÊø·½·¨µÄÖ´ÐÐ(½ö½öÒ»¸öreturnÓï¾ä)¡£
¡¡¡¡ÔÚreturnÓï¾äµÄ¸÷ÀàÎÄÕÂÖУ¬´ó¶à½ö½ö½éÉÜÁËreturnÓï¾äÓÃÓÚÓзµ»ØÖµ(·Çvoid·µ»ØÖµ)µÄ·½·¨ÖС£¶øºÜÉÙ»òûÓнéÉÜreturnÓï¾äÔÚvodi·µ»ØÖµ·½·¨ ......
//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() ......
import java.net.*;
import java.io.*;
public class ReadDemo
{
public static void main(String argv[])
{
try
{
URL url = new URL("http://blog.chinaunix.net/u/15586/showart_1863289.html");
BufferedRe ......
±êÌâ ÔÚJavaÖÐʵÏÖ¸¡µãÊýµÄ¾«È·¼ÆËã AYellow£¨Ô×÷£© ÐÞ¸Ä
¹Ø¼ü×Ö Java ¸¡µãÊý ¾«È·¼ÆËã
ÎÊÌâµÄÌá³ö£º
Èç¹ûÎÒÃDZàÒëÔËÐÐÏÂÃæÕâ¸ö³ÌÐò»á¿´µ½Ê²Ã´£¿
public class Test{
public static void mai ......