Blog Archives

01: What is wrong with following Java code snippets? Auto-unboxing, switch, short circuit & exception

Auto-unboxing, switch, short circuit logical operators & exception handling are core Java basics that sometimes lead to obscure errors if not …

Read more ›



03: What is wrong with this code? Data types & equals( ) Vs, hashCode( ) contract

Q6. What is wring with this code? A6. Infinite loop at due to sum != 1.0. Using floating point variables like … … Read more ›...

Members Only Content
Log In Register Home


04: What is wrong with this code? Java Collection & ConcurrentModificationException

Q9. What is wring with this code? A9. throws a Runtime exception called “java.util.ConcurrentModificationException” The output will be: Fix …… Read more ›...

Members Only Content
Log In Register Home


05: What is wrong with this code? Deep Vs Shallow comparison & multithreading

Q10 What is wring with this code? A10. date1 == date2 only compares the references and not the actual dates. Since … … Read more ›...

Members Only Content
Log In Register Home


06: What is Wrong with this code? Multithreading & wait/notify

An excellent written test question to assess your Java multi-threading knowledge. Please practice it by doing it yourself.

Q. Review the …

Read more ›



07: What is wrong with this code? Multithreading & locks

Q. What is wrong with the following Java code? Explain what does the following code do? Explain if there is anything …… Read more ›...

Members Only Content
Log In Register Home


08: What is wrong with this code? Generics

Q. Can you review the following code and see if it has any issues? A. The “MyStack” class is not properly … … Read more ›...

Members Only Content
Log In Register Home


09: What is wrong with this code? HashMap & Race condition

Q. What is wrong with the following code snippet? A. It is NOT thread-safe as a “HashMap” is not thread-safe as … … Read more ›...

Members Only Content
Log In Register Home


10: What is wrong with this code? ConcurrentHashMap & Atomic operations

Q. What output is expected from the following code? What does it actually output? A. It is expected to output counts … … Read more ›...

Members Only Content
Log In Register Home


What is wrong with this code? Heap Vs Stack, Thread safety & Synchronized

This post covers must know Java Multithreading basics – Heap Vs Stack, Thread-safety & Synchronization. When you have a multithreaded Java …

Read more ›



Java FAQs to Fast-track & Go places

Java Interview Q&As

Top