Explain Codes LogoExplain Codes Logo

Java

View's getWidth() and getHeight() returns 0

java
view-dimensions
custom-views
animations

Initialization of an ArrayList in one line

java
arraylist
stream-api
collections

What Java ORM do you prefer, and why?

java
orm
hibernate
jdbc

Warning: The method assertEquals from the type Assert is deprecated

java
assertions
testing
null-safety

How to verify that a specific method was not called using Mockito?

java
mockito
unit-testing
method-verification

What is a good Java library to zip/unzip files?

java
zip4j
file-compression
error-handling

Format Float to n decimal places

java
decimalformat
numberformat
performance

How can I get the current date and time in UTC or GMT in Java?

java
date-time
joda-time
timezone

Pretty-print JSON in Java

java
pretty-printing
json
gson

Using two values for one switch case statement

java
switch-case
string-objects
java-se-7

Measure execution time for a Java method

java
execution-time
profiling
performance

Java URL encoding of query string parameters

java
url-encoding
best-practices
character-sets

What is the difference between JDK and JRE?

java
jdk
jre
java-development

Make a negative number positive

java
math-abs
biginteger
ternary-operator

Convert list to array in Java

java
toarray
concurrency
autoboxing

How to convert a byte array to a hex string in Java?

java
byte-array
hex-string
performance

How do I make the method return type generic?

java
generics
type-safety
method-overloading

How do I make a delay in Java?

java
scheduledexecutorservice
lambda
thread-sleep

How to randomize two ArrayLists in the same fashion?

java
randomization
data-integrity
fisher-yates

Creation timestamp and last update timestamp with Hibernate and MySQL

java
localdatetime
hibernate
timestamps