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

Convert an Array to a Set in Java

Learn how to convert Java object arrays to Set values using HashSet, Arrays.asList, streams, and modern Java collection factories.

javacollectionsarraysset

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

Debug Android App Crashes with Logcat and Stack Traces

Learn how to diagnose “Unfortunately, MyApp has stopped” errors using Android Logcat, stack traces, exceptions, and focused fixes.

javaandroiddebuggingkotlin

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

Eclipse Java Access Restrictions: QName and rt.jar

Learn why Eclipse reports QName access restrictions in rt.jar, how Java execution environments hide newer APIs, and how to fix settings.

javaeclipsewsdlstub

Find Java Installation Paths on macOS for JNI

Learn how to locate Java and the JDK on macOS with java_home, understand JRE versus JDK installs, and configure JAVA_HOME for JNI.

javamacos

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

Page 1 of 9 - 166 questions

PreviousNext