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 understood well & often tested in coding tests.

Q1. What is wrong with this code?



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

Q6. What is wring with this code?



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

Q9. What is wring with this code?



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

Q10 What is wring with this code?



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 code shown below and then answer the following questions.



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 wrong with the following code? If there is something…



08: What is wrong with this code? Generics

Q. Can you review the following code and see if it has any issues?



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

Q. What is wrong with the following code snippet?



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

Q. What output is expected from the following code? What does it actually output?



What is wrong with this Java 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 application, you need to code in a thread-safe manner. Java interviewers may ask you to detect thread-safety issues as discussed in here.

1.What is wrong with the following code?

A very simple code that should print numbers from 7 to 21.…



800+ Java & Big Data Interview Q&As

200+ Java & Big Data Tutorials

Top