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

Java¶ÁÈ¡PropertiesÎļþµÄÁùÖÖ·½·¨

Java¶ÁÈ¡PropertiesÎļþµÄÁùÖÖ·½·¨
Java¶ÁÈ¡propertiesÎļþ
ʹÓÃJ2SE API¶ÁÈ¡PropertiesÎļþµÄÁùÖÖ·½·¨
1¡£Ê¹ÓÃjava.util.PropertiesÀàµÄload()·½·¨
ʾÀý£º InputStream in = lnew BufferedInputStream(new FileInputStream(name));
Properties p = new Properties();
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 = new PropertyResourceBundle(in);
4¡£Ê¹ÓÃclass±äÁ¿µÄgetResourceAsStream()·½·¨
ʾÀý£º InputStream in = JProperties.class.getResourceAsStream(name);
Properties p = new Properties();
p.load(in);
5¡£Ê¹ÓÃclass.getClassLoader()ËùµÃµ½µÄjava.lang.ClassLoaderµÄgetResourceAsStream()·½·¨
ʾÀý£º InputStream in = JProperties.class.getClassLoader().getResourceAsStream(name);
Properties p = new Properties();
p.load(in);
6¡£Ê¹ÓÃjava.lang.ClassLoaderÀàµÄgetSystemResourceAsStream()¾²Ì¬·½·¨
ʾÀý£º InputStream in = ClassLoader.getSystemResourceAsStream(name);
Properties p = new Properties();
p.load(in);
²¹³ä
ServletÖпÉÒÔʹÓÃjavax.servlet.ServletContextµÄgetResourceAsStream()·½·¨
ʾÀý£ºInputStream in = context.getResourceAsStream(path);
Properties p = new Properties();
p.load(in);
ÍêÕûµÄʾÀý£¬¿ÉÒԲο¼¸½¼þÎļþ
ÈçºÎÉÏ´«Îļþ£¬Ë­ÖªµÀÇë¸æËßÒÔÏ¡£ Ö»ºÃ°Ñsource¶¼ÌùÉÏÀ´ÁË
JProperties.javaÎļþ
package com.kindani;
//import javax.servlet.ServletContext;
import java.util.*;
import java.io.InputStream;
import java.io.IOException;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
public class JProperties {
public final static int BY_PROPERTIES = 1;
public final static int BY_RESOURCEBUNDLE = 2;
public final static int BY_PROPERTYRESOURCEBUNDLE = 3;
public final static int BY_CLASS = 4;
public final static int BY_CLASSLOADER = 5;
public final static int BY_SYSTEM_CLASSLOADER = 6;
public final static Propertie


Ïà¹ØÎĵµ£º

·¢ÏÖJavaºËÐļ¼ÊõµÚÆß°æÖÐÎÄÒ»´¦ÑÏÖØ·­Òë´íÎó

Java2ºËÐļ¼ÊõµÚÆß°æÖÐÎÄ°æµÚ¶þ¾í
µÚ600Ò³£¬¾¯¸æ´¦ÕâÑù˵£º
Èç¹û½«jar·ÅÈëjre/lib/extĿ¼ÖУ¬²¢ÇÒÔÚËüµÄÀàÖÐÓÐÒ»¸öÀàÐèÒªµ÷ÓÃϵͳÀà»òÕßÀ©Õ¹À࣬ÄÇô¾Í»áÓöµ½Âé·³¡£À©Õ¹Àà¼ÓÔØÆ÷²¢²»Ê¹ÓÃÀà·¾¶¡£

¸Õ¶Áµ½ÕâÀïÊ®·Ö²»½â£¬ÎªÊ²Ã´Óõ½ÏµÍ³Àà»òÀ©Õ¹Àà»á·¢Éú´íÎ󣿲¢ÇÒÒ»¸öÀàÔõô¿ÉÄܲ»»áÓõ½ÏµÍ³ÀࣿÓÚÊÇ£¬ÕÒµ½Ó¢ÎÄ°æÔ­ÎÄÈ ......

Javaѧϰ×ÊÁÏÍøÖ·


    ½ñÌìÔÚhttp://www.51itdh.com/Õâ¸öÍøÕ¾ÉÏÕÒµ½ÓкöàJavaѧϰµÄ×ÊÁÏ£¬ËùÒÔÊÕ¼¯ÏÂÀ´¸ø´ó¼Ò·ÖÏíÏ¡£Õâ¸öÍøվͦ¶à±à³ÌÕâ·½Ãæ×ÊÔ´µÄ¡£
1.JavaѧϰÍøÕ¾:
JavaÖÐÎÄÊÀ½çÂÛ̳        http://www.chinajavaworld.com/index.jspa
JavaÊÀ¼ÍÍø            &nbs ......

JAVA³ÌÐò·´±àÒ빤¾ß

JAVA³ÌÐò·´±àÒ빤¾ß
ÏÂÔصØÖ·£ºhttp://java.decompiler.free.fr/?q=jdgui
JD-GUI
JD-GUI is a standalone graphical utility that displays Java source codes of “.class” files. You can browse the reconstructed source code with the JD-GUI for instant access to methods and fields.
JD-GUI is fre ......

java¹¹ÔìÆ÷

Ô­×÷ÕߣºRobert Nielsen Ô­Õ¾£ºwww.javaworld.com
¡¡¡¡ÎÒÃÇ˵¹¹ÔìÆ÷ÊÇÒ»ÖÖ·½·¨£¬¾ÍÏó½²°Ä´óÀûÑǵÄѼ×ìÊÞÊÇÒ»ÖÖ²¸È鶯Îï¡££¨°´£ºÀÏÍâϲ»¶´ò±ÈÓ÷£¬ÎÒÒ²¾ÍÕÕ×Å·­Ò룩¡£ÒªÀí½âѼ×ìÊÞ£¬ÄÇôÏȱØÐëÀí½âËüºÍÆäËû²¸È鶯ÎïµÄÇø±ð¡£Í¬ÑùµØ£¬ÒªÀí½â¹¹ÔìÆ÷£¬ÄÇô¾ÍÒªÁ˽⹹ÔìÆ÷ºÍ·½·¨µÄÇø±ð¡£ËùÓÐѧϰjavaµÄÈË£¬ÓÈÆäÊǶÔÄÇЩҪÈÏÖ¤¿¼ÊÔ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ