Java Thread Programming (Part 4)

We need to be very careful when using the “volatile” keyword, and we should use it only where it’s required, and definitely not everywhere.

Java Thread Programming (Part 3)

Tip: We can only ask the Java thread to execute a piece of code, but we cannot guarantee the execution order of multiple threads!

Java Thread Programming (Part 2)

Let’s see an example of where we can use Threads. Let’s assume we are building a web server that returns the most used words in a website.

Java Thread Programming (Part 1)

We write code in a file line by line, and then it gets executed. To be able to execute a piece of code requires an execution environment. In Java, a thread is an executing environment. If a program has only one executing environment, then we call this program a single-threaded program.