Explain Codes LogoExplain Codes Logo

Java

Syntax for creating a two-dimensional array in Java

java
2d-arrays
array-initialization
java-best-practices

How to create a custom exception type in Java?

java
exception-handling
best-practices
custom-exceptions

Get Maven artifact version at runtime

java
maven
version
packaging

How to use a servlet filter in Java to change an incoming servlet request URL?

java
url-rewriting
servlet-filter
http-response

Runnable with a parameter?

java
lambda
functional-programming
thread-management

Jpa CascadeType.ALL does not delete orphans

java
prompt-engineering
best-practices
data-consistency

How to check type of variable in Java?

java
type-checking
instanceof-operator
reflection-api

Subclassing a Java Builder Class

java
builder-pattern
generics
inheritance

How to tell a Mockito mock object to return something different the next time it is called?

java
mockito
unit-testing
test-configuration

How to check String in response body with mockMvc

java
mockmvc
testing
spring-mvc

How to iterate over a JSONObject?

java
iterator
json-object
java-8-lambdas

Replace all substrings in Java without RegEx

java
string-manipulation
regex
performance

How do I check if the Java JDK is installed on Mac?

java
java-8
javac
jdk-management

How to convert String to long in Java?

java
long-parse
number-formatting
error-handling

Strip Leading and Trailing Spaces From Java String

java
string-manipulation
java-11
regex

How to solve the “failed to lazily initialize a collection of role” Hibernate exception

java
lazy-loading
hibernate-exception
performance-optimization

Change private static final field using Java reflection

java
reflection
best-practices
security

Converting Java objects to JSON with Jackson

java
serialization
json-serialization
jackson-library

Why should one use Objects.requireNonNull()?

java
fail-fast
null-pointer-exceptions
best-practices

How does Junit @Rule work?

java
test-engineering
best-practices
unit-testing