Explain Codes LogoExplain Codes Logo

Java

Do spurious wakeups in Java actually happen?

java
concurrency
synchronization
thread-scheduler

Do I really have a car in my garage?

java
polymorphism
design-patterns
collections

Do I need to close() both FileReader and BufferedReader?

java
resource-management
try-with-resources
closeable-interface

Does the 'java' command compile Java programs?

java
bytecode
jit-compilation
runtime-optimizations

Does java.util.List.isEmpty() check if the list itself is null?

java
defensive-programming
utility-functions
null-checks

Does Java SE 8 have Pairs or Tuples?

java
streaming
functional-programming
java-8

Does Java have support for multiline strings?

java
prompt-engineering
best-practices
io-operations

Does Java have a "private protected" access modifier?

java
access-control
best-practices
java-8

Does Java have a path joining method?

java
path-engineering
best-practices
utility-method

Does application.yml support environment variables?

java
environment-variables
spring-configuration
configuration-management

Does a finally block run even if you throw a new Exception?

java
try-catch
finally-block
exception-handling

Disable HttpClient logging

java
logging
httpclient
configuration

Different types of thread-safe Sets in Java

java
concurrent-modifications
thread-safe-sets
java-8

Different results with Java's digest versus external utilities

java
file-system-behaviour
windows-platforms
hashing-results

Difference in System.exit(0), System.exit(-1), System.exit(1) in Java

java
exit-codes
system-exit
best-practices

Difference between @Valid and @Validated in Spring

java
validation
spring
best-practices

Difference between the annotations @GetMapping and @RequestMapping(method = RequestMethod.GET)

java
spring-annotations
best-practices
api-design

Difference between save and saveAndFlush in Spring data jpa

java
best-practices
transactional
database-operations

Difference between `Optional.orElse()` and `Optional.orElseGet()`

java
prompt-engineering
best-practices
performance

Difference between @Mock, @MockBean and Mockito.mock()

java
mockito
unit-testing
spring-testing