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);
Ïà¹ØÎĵµ£º
FileÀà
Ò»¸öFileÀàµÄ¶ÔÏ󣬱íʾÁË´ÅÅÌÉϵÄÎļþ»òĿ¼¡£
FileÀàÌṩÁËÓëÆ½Ì¨Î޹صķ½·¨À´¶Ô´ÅÅÌÉϵÄÎļþ»òĿ¼½øÐвÙ×÷
Á÷ʽI/O
Á÷(Stream)ÊÇ×Ö½ÚµÄÔ´»òÄ¿µÄ¡£
Á½ÖÖ»ù±¾µÄÁ÷ÊÇ£ºÊäÈëÁ÷(Input Stream)ºÍÊä³öÁ÷(Output Stream)¡£¿É´ÓÖжÁ³öһϵÁÐ×ֽڵĶÔÏó³ÆÎªÊäÈëÁ÷¡£¶øÄÜÏòÆäÖÐдÈëһϵÁÐ×ֽڵĶÔÏó³ÆÎªÊä³öÁ÷¡£
Á÷µ ......
/**
* @param source: source image file
* @param output: output image file
* @param mode: 0 ratio,1 maxWidth,2 maxHeight,3 maxSide
* @param maxSide: maxWidth, maxHeight or maxSide, different by mode
* @param ratio: ratio if resized by ratio
*/
public static void resizeImage(File ......
±¾ÎÄÕª×Ô£º http://www.ibm.com/developerworks/cn/java/j-noaccent.html
ѧϰһÖÖеıà³ÌÓïÑÔ±ÈѧϰеĿÚÍ·ÓïÑÔÒªÈÝÒ׵öࡣȻ¶ø£¬ÔÚÕâÁ½ÖÖѧϰ¹ý³ÌÖУ¬¶¼Òª¸¶³ö¶îÍâµÄŬÁ¦È¥Ñ§Ï°²»´ø¿ÚÒôµØËµÐÂÓïÑÔ¡£Èç¹ûÄúÊìϤ C »ò C++£¬ÄÇôѧϰ Java ÓïÑÔ²¢²»À§ÄÑ£¬Õâ¾ÍÏñÊÇ»á˵ÈðµäÓïµÄÈËȥѧµ¤ÂóÓïÒ»Ñù¡£ÓïÑÔËäÓв»Í¬£¬µ«Óֱ˴˻ ......
1¡¢ public class HelloWorld {
public static void main(String args[]){
String s="daxiong";
System.out.println("Hello,World!"+"lu shenglong"+s);
char c[]={'s','w','q'};
&nb ......