learning multi-threading
1. (in java) is theading and multi-threading the same thing or not? like maybe threading used in context of single-cpu and mul...
2. what's exactly is "concurrency", "multi-threading" and "parallelism" (in java), and which of them does java true supports?
3. the linked image is from this book "learning java an introduction to real world programming" (latest edition). IDGI. we always do that, that's how we do everything right? You have to extend "Thread()" (I'm currently learning about association, aggregation, composition techniques to achieve different levels of coupling but yeah, they may be other cases how to design your classes and interfaces relation but.. leave it).

5 Replies
β This post has been reserved for your question.
Hey @π! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
π€ Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.I can shed a bit of light on the third question: no, extending classes is (in many cases) not the way to go. Itβs exactly as the linked image mentions, extending a class means inheriting all of its behaviour, and while that is sometimes desirable, often it is not. It is far more common to create classes (normal classes, but also anonymous classes/lambdas) that implement an interface; this way you get the behaviour you want but none of the baggage incurred by inheritance. Either way, you do not have to extend Thread; in fact, most facilities that deal with executing stuff in parallel (like Executors) explicitely use the Runnable interface for submitting your unit of work.
π€ Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.Java threading are the classes, methods and behaviours to use multiple threads in Java.
Java can be multithread, it can run various 'ways' of execution at the same time.
Parallelims is doing multiple things at one given moment, Java is able becaus it can launch various threads and make different things happen at the same time...
Read wikipedia and some articles about multithreading and Java threads
π€ Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.