Atitit. & #160; External class automatic loading mechanism of Trojan viruses ------ Summary of loading class methods, atitit .------

Source: Internet
Author: User

Atitit. External class automatic loading mechanism of Trojan Horse virus ------ Summary of the method for loading class, atitit .------

Atitit. External class automatic loading mechanism of Trojan Horse virus ------ Summary of the method for loading class

Atitit. java load class methods

 

1. dynamically load jar and class files. 1

2. Use the Class static method Class. forName 1

2.1. Use ClassLoader 1

2.2. Direct new 2

3. Ref 2

 

1. dynamically load jar and class files.

After completing the above two steps, you can use Class. forName to load the Java class contained in the jar or. Class file.

 

2. Use Class static method Class. forName



Class cls = Class. forName ("com. rain. B ");
B B B = (B) cls. newInstance ();

2.

Author: nickname: old wow's paw (full name: Attilax Akbar Al Rapanui Attila Akba Arla Panui) Name: AI long, EMAIL: 1466519819@qq.com

Reprinted please indicate Source: http://www.cnblogs.com/attilax/

 

2.1. Use ClassLoader


/* Step 1. Get ClassLoader */
ClassLoader cl; // for how to obtain ClassLoader, refer to 1.6.

/* Step 2. Load the class */
Class cls = cl. loadClass ("com. rain. B"); // use the ClassLoader obtained in step 1 to load B.

/* Step 3. new instance */
B B B = (B) cls. newInstance (); // a class with B gets an instance of B.

2.2. Direct new


B B = new B ();

1.

3. Ref

 

ClassLoader detailed explanation and usage (incorrect description)-mcuflower-chinaunixbok.htm

 

Dynamic Loading of jar files and class files in Java-blog channel-CSDN.NET.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.