
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Explore reflection in Java by examining objects and classes and retrieving detailed information, then invoke methods, instantiate classes, and access fields even for classes defined later.
Explore Java reflection by inspecting and invoking methods at runtime: obtain Method objects with getDeclaredMethod and getMethods, inspect names with getName, and invoke methods on objects.
Use reflection to obtain a class object's declared constructors with getDeclaredConstructors, iterate these constructor objects, and print each constructor's name for the Rectangle class.
Explore how reflection bypasses private and package-private access to fields and methods, using setAccessible, getDeclaredField, and getDeclaredMethod on a rectangle example to read and modify width and area.
Learn about Java Reflection advanced capabilities. Don't settle with the basics. Learn how to write code that explores objects and classes during runtime, indirectly invokes methods and indirectly access fields, and indirectly instantiates classes (even when the case involves a class that was created long after your code was written). In addition, learn how we can use reflection for overriding accessibility constraints, such as the private access modifier. Take this course and leverage your Java programming skills to the next level.