July 2019
Intermediate to advanced
440 pages
13h 56m
English
Reflection allows code to inspect types, methods, fields, annotations, and so forth at run time and to defer the decision about how to use them from compile time to run time. Toward that end, Java’s reflection API offers types like Class, Field, Constructor, Method, Annotation, and others. With them, it’s possible to interact with types that weren’t known at compile time: for example, to create instances of an unknown class and call methods on them.
Reflection and its use cases can quickly become complex, and I’m not going to explain it in detail. Instead, this appendix is intended to give you a high-level understanding of what reflection is, what it looks like in Java, and what you or ...
Read now
Unlock full access