Because reflection involves types that are dynamically resolved, certain Java virtual machine optimizations can not be performed. Consequently, reflective operations have slower performance than their non-reflective counterparts, and should be avoided in sections of code which are called frequently in performance-sensitive applications.java
反射是動態的對類型、方法進行解析,確定是會比直接調用慢一點。jvm沒法優化app
java反射機制,是在運行狀態中,對於任何一個類,都可以訪問這個類的全部屬性和方法,同時任何一個對象也都可以調用它的任意一個方法和屬性,這個功能稱爲java語言的反射機制。jvm