Learn what Causes java.lang.reflect.InvocationTargetException.
Search Results for: java.lang.reflect
Gson TypeToken With Dynamic List Item Type
Learn how to convert a JSON array into an equivalent List with Gson.
Set an Environment Variable at Runtime in Java
Learn how to have more control over the environment variables, especially for test scenarios.
Monkey Patching in Java
Learn how monkey patching can be used in Java, when to use it, and its drawbacks.
How to Get First or Last Entry From a LinkedHashMap in Java
Learn various methods for retrieving the first and last key-value pairs from a LinkedHashMap
Get All Record Fields and Its Values via Reflection
Explore how to retrieve all the fields and their values within a record class using Java’s Reflection API.
Is Java Reflection Bad Practice?
In this article, we’ll explore the benefits and drawbacks of using Java Reflection, trying to determine whether it qualifies as a bad practice.
Java Modularity and Unit Testing
Explore Java Modularity and learn how it affected the testing in Java applications.
What Is the JDK com.sun.proxy.$Proxy Class?
Explore how JDK’s $Proxy class works.
List All the Classes Loaded in the JVM
Learn different techniques to list all classes loaded in the JVM
New Features in Java 16
Java 16 brings a series of improvements to the language, including increments to records, sealed classes and switch statements. We review some of the new features as well as looking at some capabilities that are going away.
Diagnosing a Running JVM
In this article, we’ll see how we can diagnose a running JVM with ease.
Structural Patterns in Core Java
Learn how some core libraries in Java have adopted the seven core structural design patterns
Creating a Generic Array in Java
The loose types of Java generics are hard to coerce into the strong types of Java arrays. We explore the problem and some common solutions.
Introduction to Moshi Json
Explore Moshi – a modern JSON library for Java that will give us powerful JSON serialization and deserialization in our code with little effort.
Deny Access on Missing @PreAuthorize to Spring Controller Methods
Learn how to deny access by default on missing PreAuthorize annotations.
Key Value Store with Chronicle Map
Learn how to store and retrieve key-value pairs in Java using the Chronicle Map.
Integrating Groovy into Java Applications
Learn about the latest techniques to integrate Groovy into a Java application
Guide to Spock Extensions
Spock’s extension mechanism allows you to hook into a spec’s lifecycle to modify its behavior
Java Interview Questions
Learn the answers to common Java interview questions