62

java的反射机制的好处-姑苏城-51CTO博客

 6 years ago
source link: http://blog.51cto.com/ji123/2068928
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
java中反射是在运行中动态的加载进入。有个很大的好处就是可以节省很多资源。为什么这么说呢,首先我们来说一下jvm,jvm是java的虚拟机,java之所以支持跨平台就是因为java虚拟机的存在。程序你有如下语句Objecto=newObject();运行起来的时候,java的虚拟机会首先启动。将你的java文件编译成.class文件。加载进入你jvm的内存之中。你的类Object会加载进入方法区

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK