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.
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.
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.
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.
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.
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.
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.
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.
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[].
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Page 1 of 8 - 147 questions