java classLoader ÔÔò
ÒªÀíÀà¼ÓÔØÌåϵ½á¹¹£¬¾Í±ØÐëÇå³þÈçϼ¸µã±È½Ï»ù±¾µÄÔÔò:
1. classLoaderÊÇÒ»ÖÖ¸¸×ÓÊ÷Ðνṹ£¨×¢£ºÕâÀï²»ÊÇÖ¸Àà¼Ì³ÐµÄ¸¸×Ó¹Øϵ£©
2. ¸¸classLoaderÎÞ·¨¿´µ½×ÓclassLoader¼ÓÔصÄÀà
3¡¢ÐéÄâ»ú×ñÊØË«Ç×ίÍмÓÔØÔÔò£¬¼´ÈκÎ×ÓclassLoaderÐëÊ×ÏÈίÍи¸classLoaderÏȼÓÔØÐèÒªµÄÀ࣬µ±¸¸classLoader¼ÓÔز»µ½Ê±ÔÙÓÉ×ÓclassLoaderÇ××Ô¼ÓÔØ(ÕâÊÇÒ»¸öµÝ¹é¹ý³Ì£¬¼´¸¸classLoaderÈç¹û»¹Óи¸classLoader2£¬ÄÇô¸¸classLoaderÓÖίÍиø¸¸classLoader2£¬ÒÀ´ÎÀàÍÆ£¬Ö±µ½¸ùΪֹ£¬Èç¹û¸¸classLoaderÒѾ¼ÓÔعýÐèÒªµÄÀàclassLoader£¬Ôò×ÓclassLoaderÖ±½ÓʹÓü´¿É)
4¡¢ È«Å̸ºÔð£ºÒ»¸öclassloader¼ÓÔØÒ»¸öclassºó£¬Õâ¸öclassËùÒýÓûòÕßÒÀÀµµÄÀàÒ²ÓÉÕâ¸öclassloaderÔØÈ룬³ý·ÇÏÔʾµÄÓÃÁíÒ»¸öclassloaderÔØÈë
5¡¢ÀàÔÚÐéÄâ»úÖеıêÖ¾³öÀ´ÊÇ : classLoaderʵÀýºÅ+°üÃû+ÀàÃû£¬Òò´Ë²»Í¬µÄclassLoaderʵÀý¼ÓÔØÏàͬµÄÀàÔÚÐéÄâ»úÖбíÏÖ³öÀ´ÊDz»Í¬µÄ¡£Õâ¾ÍÊÇΪʲô¶à¸öcl¼ÓÔØͬһ¸öÀàÓÐʱºò»á³öÏÖת»»Òì³£µÄClassCastExceptionµÄÔÒò
Ïà¹ØÎĵµ£º
¸øÊý×鸳ֵµÄ±ã½Ý·½Ê½£º String s=reader.nextLine(); char a[]=s.toCharArray();ÕâÑù¾Í²»ÓÃʹÓÃÂé·³µÄforÑ»·À´¸³ÖµÁË
Êä³öÊý×éÄÚÈݵıã½Ý·½Ê½£ºString code=new String(a); //aÊÇÒ»¸öÊý×éÃû
System.out.println("ÔÎÄÊÇ"+code);
&nb ......
ÏÖÔÚ ËùÓÃJava°æ±¾,DateÀ๹Ôì·½·¨Date(0)µÄʱ¼ä²»ÊÇThu Jan 01 01:00:00 GMT 1970ÁË£¬¶øÊÇThu Jan 01 08:00:00 CST 1970¡££¨ 1970 Äê1 ÔÂ1 ÈÕ8ʱ0·Ö0Ãë ÐÇÆÚ4£©
Ϊʲô Date b1=new Date(623289600000); ²»¿ÉÒÔ£¬ÏÂÃæµÄÈ´¿ÉÒÔÄØ£¿
long a=623289600000L;
Date b1=new Date(a); Ò ......
¼¯ºÏģʽ£º
×÷Ó㺴¦ÀíÓÉһЩ¶ÔÏó×é³ÉµÄ×é»òÕß¼¯ºÏ£»´¦ÀíÈçºÎ×éÖ¯ÀàºÍ¶ÔÏóÀ´Ðγɸü´ó½á¹¹µÄϸ½Ú£»¹Ø×¢Éè¼ÆÒ»¸öÎÞÈßÓàÊý¾ÝÀàµÄ×îÓÐЧ·½·¨£»ÔÊÐíÔÚÒ»×é¶ÔÏ󹹳ɵļ¯ºÏÉ϶¨Òå²Ù×÷¡£
1. ºÏ³É£ºÔÊÐíµ¥¸ö¶ÔÏóºÏ³É¶ÔÏóÒÔÒ»ÖÖͳһµÄ·½Ê½±»·ÃÎÊ¡£»»¾ä»°Ëµ£¬ºÏ ......
Thread.currentThread().getName().equals("xxxx") ÕâÌõÓï¾ä·µ»ØÒ»¸ö bool Ð͵Ľá¹û¡£Åжϵ±Ç°ÔËÐеĽø³ÌÊÇ·ñºÍ xxxx µÄÃû×ÖÒ»Ñù¡£
¶¨ÒåÏ̵߳ÄÁ½ÖÖ·½·¨£ºclass a1 extends Thread{ } a1 xiancheng=new a1();
¶þÊÇ£ºÓýӿڻص÷¼¼Êõ¡£ class a1 implements Runnable{ } a1 ......