Àí½âJava ClassLoader»úÖÆ
µ±JVM£¨JavaÐéÄâ»ú£©Æô¶¯Ê±£¬»áÐγÉÓÉÈý¸öÀà¼ÓÔØÆ÷×é³ÉµÄ³õʼÀà¼ÓÔØÆ÷²ã´Î½á¹¹£º
bootstrap classloader
|
extension classloader
|
system classloader
bootstrap classloader £Òýµ¼£¨Ò²³ÆΪÔʼ£©Àà¼ÓÔØÆ÷£¬Ëü¸ºÔð¼ÓÔØJavaµÄºËÐÄÀà¡£ÔÚSunµÄJVMÖУ¬ÔÚÖ´ÐÐjavaµÄÃüÁîÖÐʹÓÃ-XbootclasspathÑ¡Ïî»òʹÓà - DÑ¡ÏîÖ¸¶¨sun.boot.class.pathϵͳÊôÐÔÖµ¿ÉÒÔÖ¸¶¨¸½¼ÓµÄÀà¡£Õâ¸ö¼ÓÔØÆ÷µÄÊǷdz£ÌØÊâµÄ£¬Ëüʵ¼ÊÉϲ»ÊÇ java.lang.ClassLoaderµÄ×ÓÀ࣬¶øÊÇÓÉJVM×ÔÉíʵÏֵġ£´ó¼Ò¿ÉÒÔͨ¹ýÖ´ÐÐÒÔÏ´úÂëÀ´»ñµÃbootstrap classloader¼ÓÔØÁËÄÇЩºËÐÄÀà¿â£º
URL[] urls=sun.misc.Launcher.getBootstrapClassPath().getURLs();
for (int i = 0; i < urls.length; i++) {
System.out.println(urls.toExternalform());
}
ÔÚÎҵļÆËã»úÉϵĽá¹ûΪ£º
Îļþ:/C:/j2sdk1.4.1_01/jre/lib/endorsed/dom.jar
Îļþ:/C:/j2sdk1.4.1_01/jre/lib/endorsed/sax.jar
Îļþ:/C:/j2sdk1.4.1_01/jre/lib/endorsed/xalan-2.3.1.jar
Îļþ:/C:/j2sdk1.4.1_01/jre/lib/endorsed/xercesImpl-2.0.0.jar
Îļþ:/C:/j2sdk1.4.1_01/jre/lib/endorsed/xml-apis.jar
Îļþ:/C:/j2sdk1.4.1_01/jre/lib/endorsed/xsltc.jar
Îļþ:/C:/j2sdk1.4.1_01/jre/lib/rt.jar
Îļþ:/C:/j2sdk1.4.1_01/jre/lib/i18n.jar
Îļþ:/C:/j2sdk1.4.1_01/jre/lib/sunrsasign.jar
Îļþ:/C:/j2sdk1.4.1_01/jre/lib/jsse.jar
Îļþ:/C:/j2sdk1.4.1_01/jre/lib/jce.jar
Îļþ:/C:/j2sdk1.4.1_01/jre/lib/charsets.jar
Îļþ:/C:/j2sdk1.4.1_01/jre/classes
Õâʱ´ó¼ÒÖªµÀÁËΪʲôÎÒÃDz»ÐèÒªÔÚϵͳÊôÐÔCLASSPATHÖÐÖ¸¶¨ÕâЩÀà¿âÁË°É£¬ÒòΪJVMÔÚÆô¶¯µÄʱºò¾Í×Ô¶¯¼ÓÔØËüÃÇÁË¡£
extension classloader £À©Õ¹Àà¼ÓÔØÆ÷£¬Ëü¸ºÔð¼ÓÔØJREµÄÀ©Õ¹Ä¿Â¼£¨JAVA_HOME/jre/lib/ext»òÕßÓÉjava.ext.dirsϵͳÊôÐÔÖ¸¶¨µÄ£©ÖÐJARµÄÀà°ü¡£ÕâΪÒýÈë³ýJavaºËÐÄÀàÒÔÍâµÄй¦ÄÜÌṩÁËÒ»¸ö±ê×¼»úÖÆ¡£ÒòΪĬÈϵÄÀ©Õ¹Ä¿Â¼¶ÔËùÓдÓͬһ¸öJREÖÐÆô¶¯µÄJVM¶¼ÊÇͨÓõģ¬ËùÒÔ·ÅÈëÕâ¸öĿ¼µÄ JARÀà°ü¶ÔËùÓеÄJVMºÍsystem classloader¶¼ÊǿɼûµÄ¡£ÔÚÕâ
Ïà¹ØÎĵµ£º
/**
* °ÑÎı¾±àÂëΪHtml´úÂë
* @param target
* @return ±àÂëºóµÄ×Ö·û´®
*/
public static String htmEncode(String target)
{
StringBuffer stringbuffer = new StringBuffer();
int j = target.length();
for (int i = 0; i < j; i++)
......
ÔÌâÈçÏÂ:
ÓÃ×Ö·û´®ÊäÈëµÄ·½Ê½±àдһ¸ö¼òµ¥µÄͨѶ¼¡£´ËͨѶ¼ÓɶàÌõ¼Ç¼¹¹³É¡£
ÿÌõ¼Ç¼°üÀ¨Ò»¸öÁªÏµÈ˵ÄÐÕÃû¡¢ÐԱ𡢵绰¡¢Í¨ÐŵØÖ·£¬²¢¾ßÓвéѯ¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ýµÈ¹¦ÄÜ£¬
ÇÒÿִÐÐÒ»´Î¹¦ÄܲÙ×÷ºó£¬¿ÉÒÔÑ¡ÔñÓÃÀàËÆÒÔϵĸñʽ£¬Êä³öͨѶ¼µÄËùÓÐÐÅÏ¢¼Ç¼£º
±àºÅ ÐÕÃû &nbs ......
public static void replaceString(String a,String b,String c){
System.out.println(a);
String result = a.replaceAll("(?i)"+b, c); //´óСд²»Ãô¸Ð
......
package com.mywebtest.common;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
/**
* Java reflection ·Ç³£ÓÐÓã¬ËüʹÀàºÍÊý¾Ý½á¹¹ÄÜ°´Ãû³Æ¶¯Ì¬¼ìË÷Ïà¹ØÐÅÏ¢£¬²¢ÔÊÐíÔÚÔËÐÐ× ......
JAVAÅÅÐòËã·¨£¨·ÇÔ´´£©
package Sort;
class Data {
Comparable key;
Object value;
public Data() {
}
public Data(Data data){
this.key=data.key;
this.value=data.value;
  ......