ÉîÈë̽ÌÖ Java Àà¼ÓÔØÆ÷
Àà¼ÓÔØÆ÷ÊÇ Java ÓïÑÔµÄÒ»¸ö´´Ð£¬Ò²ÊÇ Java ÓïÑÔÁ÷ÐеÄÖØÒªÔÒòÖ®Ò»¡£ËüʹµÃ Java Àà¿ÉÒÔ±»¶¯Ì¬¼ÓÔص½ Java ÐéÄâ»úÖв¢Ö´ÐС£Àà¼ÓÔØÆ÷´Ó JDK 1.0 ¾Í³öÏÖÁË£¬×î³õÊÇΪÁËÂú×ã Java Applet µÄÐèÒª¶ø¿ª·¢³öÀ´µÄ¡£Java Applet ÐèÒª´ÓÔ¶³ÌÏÂÔØ Java ÀàÎļþµ½ä¯ÀÀÆ÷Öв¢Ö´ÐС£ÏÖÔÚÀà¼ÓÔØÆ÷ÔÚ Web ÈÝÆ÷ºÍ OSGi Öеõ½Á˹㷺µÄʹÓá£Ò»°ãÀ´Ëµ£¬Java Ó¦ÓõĿª·¢ÈËÔ±²»ÐèÒªÖ±½ÓͬÀà¼ÓÔØÆ÷½øÐн»»¥¡£Java ÐéÄâ»úĬÈϵÄÐÐΪ¾ÍÒѾ×ã¹»Âú×ã´ó¶àÊýÇé¿öµÄÐèÇóÁË¡£²»¹ýÈç¹ûÓöµ½ÁËÐèÒªÓëÀà¼ÓÔØÆ÷½øÐн»»¥µÄÇé¿ö£¬¶ø¶ÔÀà¼ÓÔØÆ÷µÄ»úÖÆÓÖ²»ÊǺÜÁ˽âµÄ»°£¬¾ÍºÜÈÝÒ×»¨´óÁ¿µÄʱ¼äÈ¥µ÷ÊÔ ClassNotFoundException ºÍ NoClassDefFoundError µÈÒì³£¡£±¾ÎĽ«Ïêϸ½éÉÜ Java µÄÀà¼ÓÔØÆ÷£¬°ïÖú¶ÁÕßÉî¿ÌÀí½â Java ÓïÑÔÖеÄÕâ¸öÖØÒª¸ÅÄî¡£ÏÂÃæÊ×ÏȽéÉÜһЩÏà¹ØµÄ»ù±¾¸ÅÄî¡£
Àà¼ÓÔØÆ÷»ù±¾¸ÅÄî
¹ËÃû˼Ò壬Àà¼ÓÔØÆ÷£¨class loader£©ÓÃÀ´¼ÓÔØ Java Àൽ Java ÐéÄâ»úÖС£Ò»°ãÀ´Ëµ£¬Java ÐéÄâ»úʹÓà Java ÀàµÄ·½Ê½ÈçÏ£ºJava Ô´³ÌÐò£¨.java Îļþ£©ÔÚ¾¹ý Java ±àÒëÆ÷±àÒëÖ®ºó¾Í±»×ª»»³É Java ×Ö½Ú´úÂ루.class Îļþ£©¡£Àà¼ÓÔØÆ÷¸ºÔð¶ÁÈ¡ Java ×Ö½Ú´úÂ룬²¢×ª»»³É java.lang.Class ÀàµÄÒ»¸öʵÀý¡£Ã¿¸öÕâÑùµÄʵÀýÓÃÀ´±íʾһ¸ö Java Àࡣͨ¹ý´ËʵÀýµÄ newInstance()·½·¨¾Í¿ÉÒÔ´´½¨³ö¸ÃÀàµÄÒ»¸ö¶ÔÏó¡£Êµ¼ÊµÄÇé¿ö¿ÉÄܸü¼Ó¸´ÔÓ£¬±ÈÈç Java ×Ö½Ú´úÂë¿ÉÄÜÊÇͨ¹ý¹¤¾ß¶¯Ì¬Éú³ÉµÄ£¬Ò²¿ÉÄÜÊÇͨ¹ýÍøÂçÏÂÔصġ£
»ù±¾ÉÏËùÓеÄÀà¼ÓÔØÆ÷¶¼ÊÇ java.lang.ClassLoader ÀàµÄÒ»¸öʵÀý¡£ÏÂÃæÏêϸ½éÉÜÕâ¸ö Java Àà¡£
java.lang.ClassLoader Àà½éÉÜ
java.lang.ClassLoader ÀàµÄ»ù±¾Ö°Ôð¾ÍÊǸù¾ÝÒ»¸öÖ¸¶¨µÄÀàµÄÃû³Æ£¬ÕÒµ½»òÕßÉú³ÉÆä¶ÔÓ¦µÄ×Ö½Ú´úÂ룬Ȼºó´ÓÕâЩ×Ö½Ú´úÂëÖж¨Òå³öÒ»¸ö Java À࣬¼´ java.lang.Class ÀàµÄÒ»¸öʵÀý¡£³ý´ËÖ®Í⣬ClassLoader »¹¸ºÔð¼ÓÔØ Java Ó¦ÓÃËùÐèµÄ×ÊÔ´£¬ÈçͼÏñÎļþºÍÅäÖÃÎļþµÈ¡£²»¹ý±¾ÎÄÖ»ÌÖÂÛÆä¼ÓÔØÀàµÄ¹¦ÄÜ¡£ÎªÁËÍê³É¼ÓÔØÀàµÄÕâ¸öÖ°Ôð£¬ClassLoader ÌṩÁËһϵÁеķ½·¨£¬±È½ÏÖØÒªµÄ·½·¨Èç ±í 1 Ëùʾ¡£¹ØÓÚÕâЩ·½·¨µÄϸ½Ú»áÔÚÏÂÃæ½øÐнéÉÜ¡£
±í 1. ClassLoader ÖÐÓë¼ÓÔØÀàÏà¹ØµÄ·½·¨
·½·¨ËµÃ÷
getParent()
·µ»Ø¸ÃÀà¼ÓÔØÆ÷µÄ¸¸Àà¼ÓÔØÆ÷¡£
loadClass(String name)
¼ÓÔØÃû³ÆΪ name µÄÀ࣬·µ»ØµÄ½á¹ûÊÇ java.lang.Class ÀàµÄʵÀý¡£
findClass(String name)
²éÕÒÃû³ÆΪ name µÄÀ࣬·µ»ØµÄ½á¹ûÊÇ java.lang.Class ÀàµÄʵÀý¡£
findLoadedClass(String name)
²éÕÒÃû³ÆΪ nam
Ïà¹ØÎĵµ£º
±ÊÕßÔÚJava¿ª·¢Öг£³£»áÓöµ½½«Êý¾Ý¿âÊý¾Ýµ¼³öµ½ExcelµÄÒªÇ󣬱ÈÈçÔÚÎÒµÄÒ»¸öÏîÄ¿ÖУ¬¿Í»§ÒªÇóËùÓвéѯ½á¹û¶¼¿ÉÒÔµ¼³öµ½Excel£¬¶ÔÓÚÊý¾ÝÁ¿²»´óµÄ£¨¼¸ÍòÌõ£©£¬Õâ±È½ÏÈÝÒ×ʵÏÖ£¬µ«¶ÔÓÚÊý¾ÝÁ¿±È½Ï´óµÄ£¨¼¸Ê®Íò¼°ÒÔÉÏ£¬¾ßÌåÒª¿´µ¼³öÄÚÈݵÄ×ֶθöÊýºÍ³¤¶Ì£©£¬ÔòÔÚÊý¾Ý¿â²éѯºÍÉú³ÉexcelÎļþÉ϶¼»áÓÐÂé·³¡£
ÒÔÎÒÔÚʵ¼ÊÏîÄ¿ÖеÄÒ»¸ ......
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
public class CipherTest {
public static void main(String[] args) {
try {
byte[] keydata = { (byte) 0x00, (byte) 0x01, (byte) 0x02,
(byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06,
......
import java.util.Enumeration;
public class CipherTest implements Enumeration {
private int N;
private int c[], k;
private Object[] objs;
public CipherTest(Object[] items) {
N = items.length;
c = new int[N + 1];
for (int i = 0; i <= N; i++)
c[i] = i;
objs = items;
k = 1 ......
Õ⼸ÌìÍøÂçÓÐÎÊÌ⣬ËùÒÔ½ñÌìÒ»Æð×ܽá³öÀ´
ÀàµÄС½á
1£¬Àà³éÏóÁËËùÓоßÓÐÒ»¶¨¹²ÐÔµÄʵÌåµÄ¹²Í¬Ìسơ£Ò»¸öÀàÖУ¬±äÁ¿ÓÃÀ´±íʾÊôÐÔ£¬·½·¨ÓÃÀ´±íʾ¹¦ÄÜ£¬Àà°ÑÊý¾ÝºÍ¶ÔÊý¾ÝµÄ²Ù×÷·â×°³ÉÒ»¸öÕûÌå¡£³ÌÐòÓïÑÔÖУ¬Í¨¹ýÀà´´½¨¶ÔÏó¡£
2£¬¹¹Ô캯ÊýµÄ×÷ÓÃÔÚÓÚÉùÃ÷ÀàµÄ¶ÔÏóºó£¬ÎªÆä·ÖÅä´¢´æµ¥Ôª£¬¼´´´½¨ÊµÀý¡£
3,²»Í¬¶ÔÏóµÄʵÀý±äÁ¿½« ......
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Graphics;
import java.awt.event.*;
public class ThreadDemo extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
public ThreadDemo() {
JButton btn = new JButton("Click me");
btn.addActionL ......