Questions

Java questions

Choose a question page, learn the concept, then test your understanding with a quiz.

Add External JAR Files to an IntelliJ IDEA Java Project

Learn how to add external JAR dependencies to an IntelliJ IDEA Java project using module libraries, and when to use Maven or Gradle instead.

javaintellij-ideabuilddependency-management

Avoiding Java Code in JSP with JSP 2: EL and JSTL Explained

Learn how to avoid Java scriptlets in JSP 2 using Expression Language and JSTL, with examples, best practices, and common mistakes.

javajspscriptlet

Call a Method After a Delay in Android Java

Learn how to run Java code after a delay in Android using Handler.postDelayed, manage the main thread, and cancel callbacks safely.

javaandroidhandlerdelay

Choosing a @NotNull Annotation in Java: Validation vs Static Analysis

Learn how Java @NotNull annotations differ, when to use each one, and how to choose between validation, IDE hints, and static analysis tools.

javanullpointerexceptionnullannotations

Convert a File to byte[] in Java

Learn how to read a java.io.File into a byte array in Java using Files.readAllBytes, streams, validation, and memory-safe practices.

javafile-io

Convert a Java Stack Trace to a String

Learn how to convert a Java exception stack trace to a string using StringWriter and PrintWriter, with examples and common mistakes.

javastack-tracetostring

Convert a List to a Map in Java 8 with Streams and Collectors

Learn how to turn a List into a Map in Java 8 using streams, Collectors.toMap, method references, and duplicate-key handling.

javalambdajava-8java-stream

Convert a char to a String in Java

Learn how to convert a char to a String in Java using String.valueOf, Character.toString, and practical examples.

javastringchartype-conversion

Convert an Array to a List in Java: Arrays.asList, Primitive Arrays, and Safe Alternatives

Learn how to convert arrays to lists in Java, including why Arrays.asList behaves differently for primitive arrays like int[].

javaarrayslist

Correct Java Micro-Benchmarks with JMH

Learn how to write reliable Java micro-benchmarks with JMH, including JVM warm-up, dead-code elimination, benchmark modes, and safe timing.

javajvmbenchmarkingjvm-hotspot

Create an Executable JAR with Dependencies in Maven

Learn how to build a runnable Maven JAR with all dependencies included using plugins like Shade and Assembly.

javabuildmaven-2executable-jar

CrudRepository vs JpaRepository in Spring Data JPA

Learn the difference between CrudRepository and JpaRepository in Spring Data JPA, when to use each, and what extra features JpaRepository adds.

javaspringspring-data-jpaspring-repositories

Daemon Threads in Java: Definition, Lifecycle, and Examples

Learn what Java daemon threads are, how they differ from user threads, when the JVM stops them, and how to use them safely.

javamultithreading

Does Java Support Default Parameter Values? Overloading and Constructor Chaining Explained

Learn how Java handles default parameter values using method overloading and constructor chaining, with examples and common pitfalls.

javamethodsparametersoverloading

Does a finally Block Always Execute in Java? Exceptions, Return, and Edge Cases

Learn when a finally block runs in Java, how it behaves with return and exceptions, and the rare cases where it may not execute.

javaerror-handlingreturntry-catch-finally

Fix Eclipse Failed to Load JNI Shared Library (JDK)

Learn why Eclipse cannot load jvm.dll, how JVM and launcher architecture must match, and how to configure the correct JDK path.

javawindowseclipsejava-native-interface

Fix Hibernate Unsaved Transient Instance Errors in Java

Learn why Hibernate throws the unsaved transient instance error and how to fix entity relationships with persistence, cascades, and mappings.

javahibernatejpaorm

Fix PKIX Path Building Failed in Java SSL Certificates

Learn why Java reports PKIX path building failed, how TLS certificate chains and truststores work, and how to diagnose HTTPS trust errors safely.

javassl-certificatehttpurlconnection

Fix SLF4J StaticLoggerBinder Errors in Java Application Servers

Learn why SLF4J StaticLoggerBinder errors happen in Java servers and how to package one compatible logging binding in a WAR.

javawebsphereslf4j

Fix “Source Release 8 Requires Target Release 1.8” in IntelliJ Java

Fix IntelliJ javac source release 8 requires target release 1.8 by aligning Java source and bytecode target settings in projects.

javaintellij-ideajava-8

Page 1 of 8 - 147 questions

PreviousNext