New course! Every coder should learn Generative AI!
Try a free lesson0
By using threads you can do things parallel.
This is important for networking as Downloading data takes time and shouldn't be done on the ui thread.
Example:
https://code.sololearn.com/c5SJ5FGm5M98/?ref=app
It isn't completely parallel because of the online jvm.
For networking use sockets.
https://docs.oracle.com/javase/tutorial/networking/sockets/index.html
The official tutorials are always good.