Pages

Topics

Tools

↑↓navigate↵openescclose

Java guides

Every published Java guide, newest first, with practical examples you can copy into your own project.

3,965 guides across 14 topics

Topics

Latest Java guides

Illustration of a Java class with a serialVersionUID field and a serialized object stream.
Java

Java serialVersionUID: Purpose and Best Practices

java serialversionuid: Learn what serialVersionUID is, why Java uses it during deserialization, and how to declare it to keep serialized objects compatible across vers...

Java serializationserialVersionUIDSerializable interfaceObjectOutputStream
A Java object being converted into a byte stream and restored, illustrating the Serializable interface.
Java

Java Serializable: Implementation and Safe Usage

Learn how Java's Serializable interface works, how to implement it correctly, handle serialVersionUID, and avoid common deserialization pitfalls.

serializationserialVersionUIDObjectOutputStreamdeserialization
A Java object being converted into a byte stream and then reconstructed, illustrating the serialization and deserialization process.
Java

Understanding Java Serialization

Learn how Java serialization works, how to control it with serialVersionUID and transient fields, and when to choose native serialization over alternatives.

Java SerializationSerializableserialVersionUIDDeserialization
Illustration of Java reflection accessing a private field with a key unlocking a lock, representing encapsulation bypass.
Java

Java Reflection Private Field Access

java reflection private field access: Learn how to access private fields in Java using reflection, including setAccessible, exception handling, module restrictions, an...

Java reflectionprivate fieldssetAccessibleJava modules
Illustration of a magnifying glass inspecting annotation symbols on a Java class diagram, representing runtime reflection and metadata access.
Java

Reading Java Reflection Annotations at Runtime

java reflection annotations: Learn how to use Java reflection to read custom annotations at runtime, including retention policies, method and field inspection, and pra...

reflectionannotationsruntimemetadata
A magnifying glass over a Java class structure with a method call arrow, representing reflective method invocation at runtime.
Java

Java Invoke Method Reflection: A Practical Guide

java invoke method reflection: Learn how to invoke methods reflectively in Java: obtaining Method objects, handling parameters, access control, exceptions, and perform...

Java ReflectionMethod InvocationRuntime APIException Handling
Illustration of Java reflection creating an object from a class at runtime, with a constructor call.
Java

Java newInstance Reflection: Creating Objects at Runtime

java newinstance reflection: Learn how to use Java reflection to create objects at runtime, compare Class.newInstance() and Constructor.newInstance(), and understand p...

Java reflectionnewInstanceConstructorruntime instantiation
Diagram showing Java reflection constructor inspection and invocation process
Java

Java Reflection Constructor: Inspect and Invoke at Runtime

Use Java reflection to inspect and invoke constructors at runtime, including public, private, and parameterized constructors, with code examples.

JavaReflectionConstructorsDynamic Instantiation
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