Class loading

A typical approach for loading a class in memory relies on calling the Class.forName(String className) method. Notice the String argument representing the class name. Thanks to string immutability, the class name cannot be changed during the loading process. However, if String is mutable, then imagine loading class A (for example, Class.forName("A")), and, during the loading process, its name will get changed to BadA. Now, the BadA objects can do bad things!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.246.148