Java Thread Programming (Part 7)
Can we create as many Java threads as we want? I will try to come up with an answer via an exercise, so bear with me!

A N M Bazlur Rahman is a Software Engineer with over a decade of specialized experience in Java and related technologies. His expertise has been formally recognized through the prestigious title of Java Champion. Beyond his professional commitments, Mr. Rahman is deeply involved in community outreach and education. He is the founder and current moderator of the Java User Group in Bangladesh, where he has organized educational meetups and conferences since 2013. He was named Most Valuable Blogger (MVP) at DZone, one of the most recognized technology publishers in the world. Besides DZone, he is an editor for the Java Queue at InfoQ, another leading technology content publisher and conference organizer, and an editor at Foojay.io, a place for Friends Of OpenJDK. In addition, he has published five books about the Java programming language in Bengali; they were bestsellers in Bangladesh. He earned his bachelor's degree from the Institute of Information Technology, University of Dhaka, Bangladesh, in Information Technology, majoring in Software Engineering. He currently lives in Toronto, Canada.
8 views
A N M Bazlur Rahman
5,375 viewsCan we create as many Java threads as we want? I will try to come up with an answer via an exercise, so bear with me!

A N M Bazlur Rahman
5,112 viewsHave you ever wondered what is the purpose of the "wait()", "notify()", "notifyAll()" methods that come with each Java object?
A N M Bazlur Rahman
3,939 viewsOptional is a mystery box, a wrapping paper: it may not contain value. When we specify that in a signature, we assume the box might be …

A N M Bazlur Rahman
5,187 viewsWhen a thread acquires a lock object, no other thread will be able to use it. Once a thread unlocks the lock, other threads acquire it …
A N M Bazlur Rahman
6,445 viewsWe need to be very careful when using the "volatile" keyword, and we should use it only where it’s required, and definitely not everywhere.

A N M Bazlur Rahman
7,040 viewsTip: We can only ask the Java thread to execute a piece of code, but we cannot guarantee the execution order of multiple threads!

A N M Bazlur Rahman
6,847 viewsLet'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.
A N M Bazlur Rahman
15,688 viewsTo be able to execute a piece of code requires an execution environment. In Java, a thread is an executing environment.
A N M Bazlur Rahman
5,277 viewsLearn how using compact strings can help you reclaim 25% of Java heap memory and lower your Cloud bills... very easily.