¼¸ÖÖ¶ÁÈ¡ÊôÐÔÎļþµÄJAVAʵÏÖ·½Ê½
1.ʹÓÃjava.util.PropertiesÀàµÄload()·½·¨
¡¡¡¡
¡¡¡¡Ê¾Àý£º
Java´úÂë
InputStream in = lnew BufferedInputStream(new FileInputStream(name));
¡¡¡¡Properties p = new Properties();
¡¡¡¡p.load(in);
InputStream in = lnew BufferedInputStream(new FileInputStream(name));
¡¡¡¡Properties p = new Properties();
¡¡¡¡p.load(in);
¡¡¡¡
¡¡¡¡2.ʹÓÃjava.util.ResourceBundleÀàµÄgetBundle()·½·¨¡¡¡¡
¡¡¡¡Ê¾Àý£º
Java´úÂë
ResourceBundle rb = ResourceBundle.getBundle(name, Locale.getDefault());
ResourceBundle rb = ResourceBundle.getBundle(name, Locale.getDefault());
¡¡¡¡
¡¡¡¡3.ʹÓÃjava.util.PropertyResourceBundleÀàµÄ¹¹Ô캯Êý¡¡¡¡
¡¡¡¡Ê¾Àý£º
Java´úÂë
InputStream in = new BufferedInputStream(new FileInputStream(name));
¡¡¡¡ResourceBundle rb = new PropertyResourceBundle(in);
InputStream in = new BufferedInputStream(new FileInputStream(name));
¡¡¡¡ResourceBundle rb = new PropertyResourceBundle(in);
¡¡¡¡
¡¡¡¡4.ʹÓÃclass±äÁ¿µÄgetResourceAsStream()·½·¨¡¡¡¡
¡¡¡¡Ê¾Àý£º
Java´úÂë
InputStream in = JProperties.class.getResourceAsStream(name);
¡¡¡¡Properties p = new Properties();
¡¡¡¡p.load(in);
InputStream in = JProperties.class.getResourceAsStream(name);
¡¡¡¡Properties p = new Properties();
¡¡¡¡p.load(in);
¡¡¡¡
¡¡¡¡5.ʹÓÃclass.getClassLoader()ËùµÃµ½µÄjava.lang.ClassLoaderµÄgetResourceAsStream()·½·¨¡¡¡¡
¡¡¡¡Ê¾Àý£º
Java´úÂë
InputStream in = JProperties.class.getClassLoader().getResourceAsStream(name);
¡¡¡¡Properties p = new Properties();
¡¡¡¡p.load(in);
InputStream in = JProperties.class.getClassLoader().getResourceAsStream(name);
¡¡¡¡Properties p = new Properties();
¡¡¡¡p.load(in);
¡¡¡¡
¡¡¡¡6.ʹÓÃjava.lang.ClassLoad
Ïà¹ØÎĵµ£º
/*
* EncryptUtils.java
* Copyright (C) 2007-3-19 <JustinLei@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ......
/*
* CookieSupport.java
* Copyright (C) 2007-3-19 <JustinLei@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version ......
JavaÄÚ²¿À൱³õµÄÉè¼ÆÄ¿µÄÓ¦¸ÃÊÇʵÏÖ¶àÖØ¼Ì³Ð£¬ºóÀ´·¢ÏÖÄÚ²¿À໹´øÀ´ÁËÆäËûºÃ´¦£¬Èç¿ÉÒÔʹÓÃÄÚ²¿Àà°üװһЩº¯Êý£¬ÊµÏÖº¯Êý¼¶±ðµÄȨÏÞ¿ØÖƵȡ£
JavaÖУ¬LIst.subList()µÈ·½·¨²úÉúµÄÊÇÒ»¸öview£¬¼´²»ÊÇ´«Öµ£¬¶ø½öÊÇÒýÓá£ËƺõÔÚjavaÖгýÁËprimitiveÀ࣬ÆäËûÀà¶¼Ðènew²ÅÄܲúÉúжÔÏó¡£
iBatis DAO¿ò¼ÜÍ ......
Àࣺ
·ÃÎÊÐÞÊηû ÐÞÊηû class ÀàÃû³Æ extends ¸¸ÀàÃû³Æ implement ½Ó¿ÚÃû³Æ
£¨·ÃÎÊÐÞÊηûÓëÐÞÊηûµÄλÖÿÉÒÔ»¥»»£©
·ÃÎÊÐÞÊηû
Ãû³Æ
˵Ã÷
±¸×¢
public
¿ÉÒÔ±»ËùÓÐÀà·ÃÎÊ£¨Ê¹Óã©
publicÀà±ØÐ붨ÒåÔÚºÍÀàÃûÏàͬµÄͬÃûÎļþÖÐ
package
¿ÉÒÔ±»Í¬Ò»¸ö°üÖеÄÀà·ÃÎÊ£¨Ê¹Óã©
ĬÈϵķÃÎÊȨÏÞ£¬¿ÉÒÔÊ¡ÂԴ˹ؼ ......
1.дһ¸öðÅÝÅÅÐòµÄ³ÌÐò¡£
public class Sort
{
public static void main(String[] args)
{
&n ......