Questions

Java questions

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

Why Eclipse Says “Must Override a Superclass Method” in Java Android Projects

Learn why Eclipse shows “must override a superclass method” in Java Android projects after re-importing, and how to fix it correctly.

javaandroideclipseoverriding

Why Java Compound Assignment Operators Like += Don’t Require Casting

Learn why Java compound assignment operators like += compile without explicit casts, and how they differ from normal assignment.

javacastingoperatorsvariable-assignment

Why Java Has transient Fields: Serialization Explained

Learn why Java uses transient fields, how serialization works, and when to exclude fields from saved object state.

javafieldtransient

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 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 4 of 4 - 69 questions