Questions

Java questions

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

How to Declare and Initialize an Array in Java

Learn how to declare and initialize arrays in Java with simple examples, syntax, common mistakes, and practical use cases.

javaarrays

How to Deserialize a JSON Array of Objects with Jackson in Java

Learn how to deserialize a JSON array of objects into Java arrays or List<MyClass> using Jackson with clear examples and common pitfalls.

javajsonjackson

How to Download a File in Android and Show Progress in a ProgressDialog

Learn how to download a file in Android and update a ProgressDialog with download progress using beginner-friendly Java examples.

javaandroiddownloadandroid-asynctask

How to Fix "No Main Manifest Attribute" in a JAR File (Java)

Learn what "no main manifest attribute" means in Java, why it happens, and how to inspect or run a JAR correctly.

javajarmanifestprogram-entry-point

How to Fix Eclipse Exit Code 13: 32-bit vs 64-bit Java on Windows

Learn why Eclipse returns exit code 13 on Windows and how to fix Java bit-version mismatches, javaw.exe path issues, and VM settings.

javaandroidwindowseclipse

How to Fix Jackson Unrecognized field Error in Java JSON Mapping

Learn why Jackson throws 'Unrecognized field' in Java and how to map JSON field names correctly with wrapper objects and annotations.

javajsondata-bindingjackson

How to Fix NetworkOnMainThreadException in Android (Java)

Learn why Android throws NetworkOnMainThreadException and how to fix it using background threads for network requests in Java.

javaandroidandroid-networkingnetworkonmainthread

How to Fix UnsupportedClassVersionError in Java: JRE vs JDK and Version Mismatch

Learn why Java UnsupportedClassVersionError happens, how JRE and JDK differ, and how to fix class version mismatches correctly.

javajvmincompatibilityunsupported-class-version

How to Fix javax.xml.bind.JAXBException NoClassDefFoundError in Java 9+

Learn why JAXB is missing in Java 9+ and how to fix javax.xml.bind.JAXBException NoClassDefFoundError with modules or dependencies.

javajaxbjava-9java-11

How to Generate a Random Alphanumeric String in Java

Learn how to generate random alphanumeric strings in Java with flexible length, practical examples, uniqueness tips, and common mistakes.

javastringrandomalphanumeric

How to Generate an MD5 Hash in Java

Learn how to generate an MD5 hash in Java using MessageDigest, convert bytes to hex, and understand when MD5 should and should not be used.

javahashmd5hashcode

How to Get the Current Stack Trace in Java

Learn how to get the current stack trace in Java, return it as data, and use StackTraceElement safely in logging and debugging.

javastack-trace

How to Get the Current Working Directory in Java

Learn how Java gets the current working directory, why user.dir may show system32, and how to resolve file paths correctly.

javajava-io

How to Initialize a HashMap in Java: Literal-Like Syntax and Best Practices

Learn how to initialize a Java HashMap with fixed values, why Java has no map literal syntax, and the best modern alternatives.

javadictionarycollectionsinitialization

How to Initialize a Static Map in Java

Learn how to initialize a static Map in Java, including static blocks, double-brace initialization, Map.of, and best practices.

javadictionarycollectionsinitialization

How to Install and Configure Java 8 on Mac

Learn how Java 8 is installed on macOS, why JDK paths differ, and how to verify and configure the correct Java version.

javamacosjava-8installation

How to Iterate Over a Java Map Efficiently

Learn the most efficient ways to iterate over a Java Map, when to use entrySet, and how ordering depends on the Map implementation.

javadictionarycollectionsiteration

How to Iterate Through a HashMap in Java

Learn the best ways to iterate through a HashMap in Java, with examples using entrySet, keySet, values, and forEach.

javaloopshashmapiteration

How to Join Two Lists in Java Without Modifying the Originals

Learn how to join two lists in Java using JDK-only approaches, including addAll, streams, and older Java-compatible techniques.

javalistmergejava-5

How to Left Pad Integers with Leading Zeros in Java

Learn how to pad integers with leading zeros in Java using String.format and DecimalFormat with clear examples and common mistakes.

javaformattingzero-pad

Page 3 of 6 - 117 questions