Questions

Java questions

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

Why Printing "B" Can Be Slower Than "#" in Java Console Output

Learn why Java console printing speed can vary by character, especially in IDE consoles, and how buffering and rendering affect timing.

javaperformanceloopsfor-loop

Why RecyclerView Doesn’t Have onItemClickListener() in Android

Learn why RecyclerView has no onItemClickListener(), how click handling works, and the best Android patterns for item clicks.

javaandroidandroid-recyclerview

Why Seeded Random Produces Predictable Strings in Java

Learn why Java Random with fixed seeds prints predictable text like hello world, and how seeded pseudorandom generators work.

javastringrandom

Why Sorted Arrays Can Be Faster in C++: Branch Prediction Explained

Learn why looping over a sorted array can run much faster in C++ and Java, mainly due to CPU branch prediction and predictable control flow.

javacppperformancecpu-architecture

Why Use Getters and Setters in Java? Accessors vs Public Fields

Learn why Java uses getters and setters, when they help, when public fields are fine, and how encapsulation affects real code design.

javaoopsettergetter

Why char[] Is Preferred Over String for Passwords in Java

Learn why Java often uses char[] instead of String for passwords, including security reasons, examples, mistakes, and best practices.

javastringsecuritypasswords

wait() vs sleep() in Java: Thread Coordination and Pausing Explained

Learn the difference between wait() and sleep() in Java, including locks, CPU usage, thread states, and when to use each one.

javamultithreadingwaitsleep

Page 8 of 8 - 147 questions