Browse by Topic

Popular

Latest

Latest Java Posts

Java reflection getMethods() discovering public methods on a class diagram
Java

Java getMethods: Discovering Public Methods with Reflection

Learn how Java's getMethods() discovers public methods at runtime, what it returns, and how it differs from getDeclaredMethods().

Java reflectiongetMethodsmethod introspectionruntime API
Illustration of Java reflection getDeclaredMethods showing a class with its declared methods exposed.
Java

java getDeclaredMethods: How to Use Reflection

Learn how to use Java reflection's getDeclaredMethods() to inspect class methods, access private methods, and avoid common pitfalls.

Java ReflectionMethod InspectionRuntime APIClass Metadata
Diagram showing a Java class hierarchy with public fields highlighted and the getFields() method returning inherited public fields.
Java

Java getFields() Method: Accessing Public Fields in Reflection

java getfields: Learn how Java's getFields() method returns public fields, including inherited ones, and how it differs from getDeclaredFields() in reflection.

Java reflectiongetFieldsgetDeclaredFieldsField class
Java code snippet showing getDeclaredFields() reflection call with a magnifying glass over a class diagram
Java

java getDeclaredFields: Inspecting Class Fields

Learn how to use Java's getDeclaredFields() to inspect a class's fields at runtime, including private and protected members, and how it differs from getFields().

Java ReflectiongetDeclaredFieldsField ClassAccess Modifiers
Illustration of Java Class.forName loading a class dynamically with initialization steps shown as gears and a class object.
Java

Java Class.forName: Dynamic Class Loading Explained

Understand how Java's Class.forName method loads and initializes classes at runtime, including initialization side effects and when to use it instead of ClassLoader.loadClass.

ReflectionClassLoaderJDBCDynamic Loading
Diagram showing an object's runtime class retrieved via getClass() in Java
Java

java getclass: How to Get the Runtime Class of an Object

Learn how java getclass returns the runtime class of an object, how to use it for type checks, and where it differs from instanceof.

JavagetClassReflectionType System
Illustration of a Java class blueprint and an object instance with memory reference
Java

Java Class and Object: Definition and Runtime Behavior

Understand how Java classes define object structure and behavior, how objects are instantiated and stored in memory, and how object references behave at runtime.

JavaObject-Oriented ProgrammingClass InstantiationJava Memory Model
Diagram of a magnifying glass inspecting a Java class blueprint with fields and methods revealed at runtime.
Java

Using the Java Reflection API for Runtime Class Analysis

See how to inspect classes, invoke methods, and read annotations at runtime with the Java Reflection API, including performance and compatibility trade-offs.

JavaReflectionRuntimeClass Metadata
Illustration of Java reflection concept showing a class being inspected at runtime
Java

Java Reflection: Inspecting and Modifying Runtime Behavior

Learn how to inspect classes, invoke methods, and access fields at runtime with Java reflection, including performance tradeoffs and alternatives.

reflectionruntimeclassmethod
A Java annotation element represented as a labeled slot inside a class file, with a magnifying glass showing reflection reading its value.
Java

Java Annotation Element: Declaration, Types, and Defaults

Learn how to declare Java annotation elements, their allowed types, default values, and runtime reflection behavior.

Java annotationsannotation elementscustom annotationsreflection