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.

javaarraysstringarraylist

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.

javaarraysjava-8java-stream

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.

javastringdatetime

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.

javaenums

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.

javastringtype-conversioninputstream

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.

javastringtype-conversioninteger

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.

javaarraysarraylisttype-conversion

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.

javaarraysinputstream

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.

javastringiostream

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.

javaobjectcopyclone

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.

javaarraysgenericsreflection

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.

javalistcollections

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.

javamemorymemory-leaks

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.

javafile-io

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

Page 3 of 8 - 147 questions