Blog Archives

01: ♥♦15+ Java multithreading interview questions & answers

Q1. What is a thread? A1. It is a thread of execution in a program. The JVM allows an application to have multiple threads of execution running concurrently. In the Hotspot JVM there is a direct mapping between a Java Thread and a native operating system (i.e. OS) Thread. The

Read more ›

Posted in FAQs Core Java, Multithreading
Tags: ,

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

Read more ›

Posted in FAQs Free, Multithreading, What is wrong with this code?
Tags: ,

03: ♦ 7 Things you must know about Java locks and synchronized key word

7 Things you must know about Java locks and synchronized key word summarizes the key basics. #1. Each Java class and object (i.e. instance of a class) has an intrinsic lock or monitor. Don’t confuse this with explicit lock utility class that were added in Java 1.5, and I will…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home
Posted in member-paid, Multithreading, Understanding Core Java

04: ♦ 6 popular Java multithreading interview Q&As for the experienced

Q1. Why do threads need to communicate with each other? A1. Inter thread communication is very similar to inter process communication where 2 or more processes communicate with other, the only difference being that inter thread communication happens within the same process (i.e. within the same memory model). Inter thread…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home
Posted in member-paid, Multithreading
Tags: ,

05: ♦ 9 Java multithreading Q&As on concepts like blocking, sequencing, preempting & daemon threads

Java multithreading Q&As on concepts like blocking, and debugging blocked threads. How do you sequence threads? what do you understand by the term preemptive scheduling? Q1. What are the different ways a Java thread gets blocked or suspended? How will you debug Java threading issues? A1. 1. It has been…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home
Posted in member-paid, Multithreading
Tags: ,

06: ♦ 10+ Atomicity, Visibility, and Ordering interview Q&A in Java multi-threading

Q1. Why is it important to understand the difference between the “JVM memory model” and the computer “hardware memory model”? A1. 3 reasons why it is important to understand the JVM memory model and computer hardware memory model are: 1) JVM memory model and the physical hardware memory model architectures…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home
Posted in JVM, member-paid, Multithreading

07: ♦ Java ThreadLocal Interview questions & answers

Java ThreadLocal Interview questions & answers in detail with code focusing more on when to use it and how to not abuse it. Q1. What is a ThreadLocal class? When to use it? How to not abuse it? A1. ThreadLocal is a handy class for simplifying development of thread-safe concurrent…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home
Posted in member-paid, Multithreading

07: Java FP – CompletableFuture monadic chaining with examples – part 1

This extends Future Vs. CompletableFuture interview Q&As with Java 8 functional programming (i.e. FP). Q1. Why was CompletableFuture introduced in Java 8 when you already had the Future interface? A1. The CompletableFuture implements both CompletionStage<T> and Future<T> interfaces. Hence it provides the functionality of the Future interface in terms of…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home
Posted in member-paid, Multithreading, OOP vs FP Coding Java 8

08: ♦ 7 basic Java Executor framework Interview Q&As with Future & CompletableFuture

Basic level Java Executor framework Interview Q&As with Future & CompletableFuture (introduced in Java 8), which you would be using very often in Java apps. Q01. What is an Executor Framework? A01.In Java 5, Executor framework was introduced with the java.util.concurrent.Executor interface. This is a framework for 1) facilitating thread-pools.…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home
Posted in member-paid, Multithreading

08: CompletableFuture monadic chaining with examples – part 2

This extends Java FP – CompletableFuture monadic chaining with examples – part 1. f and g are processed asynchronously, and then combined A “Supplier” returns a result by taking nothing as an argument. “CompletableFuture.supplyAsync” executes a “Supplier” without blocking. This means executes it asynchronously. By using the Async suffix, each…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home
Posted in member-paid, Multithreading, OOP vs FP Coding Java 8

09: Java FutureTask example

Java 5 introduced the concurrent package for more efficient multi-threading. Q. What is the difference between Future and FutureTask in asynchronous processing? A. Future is the interface and FutureTask is the base implementation of the Future with methods to start and cancel a computation. The FutureTask provides asynchronous computation with

Read more ›

Posted in Multithreading

10: ♦ ExecutorService Vs Fork/Join & Future Vs CompletableFuture Interview Q&As

Q1. What is the difference between “ExecutorService” and “Fork/Join Framework“? A1. The Fork/Join framework uses a special kind of thread pool known as the ForkJoinPool, which is a specialized implementation of ExecutorService implementing the 1) work-stealing algorithm, in which the idle workers steal the work from those workers who are

Read more ›

Posted in Java 8, Multithreading, Reactive Programming

11: 10+ ♦ Java multi-threading scenarios interview Q&As

Java multi-threading interview questions are very popular from beginner to experienced level candidates. Many struggle, including the so called experienced. That is why interviewers love this key area of concurrency management to assess your capabilities. In Java, there are low level interfaces/classes to higher abstraction levels to implement concurrency 1)…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home
Posted in FAQs Core Java, member-paid, Multithreading

12: ♦ 5 Java multithreading scenarios interview questions answered

This extends Q1. Can you give some scenarios where you had used multi-threading in Java applications? Q2. Can you give some scenarios where you used the synchronized keyword in Java? A2. Firstly, you need to assume that your code is always going to be accessed by multiple threads. Scenario 1:…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home
Posted in Concurrency, member-paid, Multithreading
Tags:

13: ♥♦ 5 Ways to debug Java thread-safety issues

Interviewers often judge your experience with debugging skills. For example, debugging jar hell issues, debugging SSL issues, debugging hibernate issues, debugging transaction management issues, etc. All these are covered in detail at Debugging Skills How will you debug thread-safety issues in Java? A very popular Java job interview question for

Read more ›

Posted in Concurrency, Debugging Tutorial, FAQs Free, FAQs Java Key Areas, Java Debugging, Multithreading
Page 1 of 212

800+ Java Q&As – ♥Free | ♦FAQs

open all | close all

100+ Java Tutorials – Step by step

open all | close all

How good are your

open all | close all