java.lang.reflect Method and Field

Your method is private but getMethod() only returns public method.
You need to use getDeclaredMethod().

Your field is private but getField() only returns public field.
You need to use getDeclaredField()


Written by malic in All on 火 19 3月 2024. Tags: 程序设计 Java