Having said so much, I haven’t written down several basic functions of threads. Now let’s supplement
start a thread
T1=new YourThread();
T1.start()
operate threads
T1.run() , As mentioned before, starting the thread will automatically perform this operation
Suspend
T1.suspend()//It is different from Sleep(), it means suspending a thread without setting a time
Corresponding to suspension, we also You can reactivate a thread
T1.resume()
Stop the thread
T1.stop()//But it does not destroy the thread
Test whether the thread is activated
T1.isAlive()//This is a function, returned It is a Boolean value
Enter network programming: Sockets
See how much I can understand from memory: Sockets are in the session layer of the seven-layer protocol. Its job is to tell the application that it is going to send information to the network and hide the sending details. Open For example, when we make a phone call, we only need to dial the number, pick up the receiver, and speak. We don’t need to care about how our voice is transmitted to the other party through the phone line. Sockets are the phone, and all the secrets are It's all in this phone.
I took a preliminary look at the concept of Sockets, and it seems that there are some things in the programs involved that I haven’t touched yet, so I’ll put them aside first.
The above is the content of the memo (4) for beginners learning Java. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!