Questions
Java questions
Choose a question page, learn the concept, then test your understanding with a quiz.
How to Convert ArrayList<String> to String[] in Java
Learn how to convert an ArrayList<String> to a String[] in Java using toArray(), with examples, mistakes to avoid, and practical use cases.
How to Convert a Java 8 Stream to an Array
Learn how to convert a Java 8 Stream to an array using toArray(), typed arrays, examples, pitfalls, and real-world usage.
How to Convert a String to a Date in Java
Learn how to convert a String like 'January 2, 2010' to a date in Java using date parsing and modern date-time APIs.
How to Convert a String to an Enum in Java
Learn how to get an enum value from a string in Java using Enum.valueOf(), with examples, errors, validation, and best practices.
How to Convert a String to an InputStream in Java
Learn how to convert a String to an InputStream in Java using byte arrays, character encodings, and practical examples.
How to Convert a String to an int in Java
Learn how to convert a String to an int in Java using parseInt and valueOf, with examples, mistakes, and practical use cases.
How to Convert an Array to an ArrayList in Java
Learn how to convert an array to an ArrayList in Java, including syntax, examples, common mistakes, and real project usage.
How to Convert an InputStream to a Byte Array in Java
Learn how to read an entire InputStream into a byte array in Java using simple patterns, examples, and common best practices.
How to Convert an InputStream to a String in Java
Learn how to read a Java InputStream into a String safely using charset-aware techniques, examples, pitfalls, and best practices.
How to Copy Objects in Java: References, Shallow Copies, and Deep Copies
Learn why Java object assignment shares references and how to create independent copies with copy constructors, shallow copies, and deep copies.
How to Create Generic Arrays in Java Safely
Learn why Java forbids generic array creation and how to create generic arrays safely using reflection and collections.
How to Create a List in Java
Learn how to create and use List objects in Java with ArrayList and LinkedList, including generics, examples, common mistakes, and best practices.
How to Create and Understand a Memory Leak in Java
Learn what a Java memory leak is, how it happens, simple examples, common causes, and how developers prevent leaks in real code.
How to Create and Write to a File in Java
Learn the simplest ways to create and write text files in Java using FileWriter, BufferedWriter, and Files.write examples.
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.
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.
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.
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.
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.
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.