Search⌘ K

Introduction

Reflection in Java is an API that allows runtime examination and modification of methods, classes, and interfaces. It enables dynamic calls to methods like 'doSomething' on objects of unknown types, and facilitates operations such as instantiating objects and accessing fields. However, reflection has drawbacks including decreased performance due to dynamic type resolution, potential security risks, and the ability to break encapsulation which may lead to unexpected behavior. Use cases include development tools, debugging, runtime class loading, and mapping properties from JSON or JDBC ResultSets to Java object methods.

We'll cover the following...
1.

What is Reflection in Java?

Show Answer
1 / 3
...