Heydon ng
2 min readAug 26, 2022

java — multithreading of using

  1. the multithreading ‘ s concept

the concept is taking about the programmer which is able to run simultaneously ,it will be abstract , so i will talk about this by a example ,such as originally we have a single manager who only manages the one thing ,now we have 3 managers who are able to do different things in view of finishing works effectively.Therefore , a manage means doing a single thing only , but mult-manager means doing different simultaneously.Moreover, there are two houses where have a sharing totel ,so it means totel which is the multithreading ,and people are to use the totel simultaneously.

2.why using multithraeding ?

the reason why we will use the multithraeding is that we hope to run two or three programmes simultaneously; moreover, we will want to have waiting space in that we will use the multithraeding ,and we also use the multithraeding for background processing programm.

3.how to use the multithreading ?

Firstly , we need to extend the thread , and we have to overwrite the run method which can entry your programmer.Moreover , we are able to create an new class , using the main method ,creating a facing object according to your using run method class .furthermore , we can use the variety to use the start method that is multithraeding.

4.how to use 2 multithreading?

the answer is creating an new class!The example is that programmer p = new programmer ();creating a new space for the sake of having a space to use the start method.

Important

using a anonymous object is a significant skill, so i will teach it in here inasmuch as the format should be that

new x(){}.start();friendly remind ,the x is class

5.crucial skill

  • void start();to use the override method

*void run();for entry your programmer

*string getName();show the multthreading name (using in the run method)

*void setName();set the multithraeding name(using in the main method)

*currentThread();return now multithraeding

*yield();release the right of multithraeding that can process itself or other of threading (try -catch)

*join();stop in a place temporarily.(try -catch)

*sleep();wait for a setting time,and the result will release in sometime

*isAlive();true of false the threading

Heydon ng

i am a java student , wanting to share my opinions to others,asmuch as i will share useful tech Information to you , and where there is a will, there is a way.