+ 5
Please Explain Me! What is "thread" in JAVA?
I didnt get it till now since 2 months 😢😢😢😢! All you sololearners , please help me 😎😎
8 Answers
+ 7
Please
+ 4
Didnt get it😣😣😣😣
+ 3
thread is where your code running, so in multi-thread your code will run at different place thus it will make both code(or more) able to run at the sametime.
+ 3
Think about roads with a few lanes, imagine a car is the code and thread is the lane.
By using single thread that means every car/code are using a single lane to run/move. What ever we do the car at the front will always arrive first.
By creating a thread, it allows some cars to move at the other lane(s) so they can move and arrive at same time.
+ 2
Again same thing........ 😢😢
+ 1
Creating Threads allows the later part of the code to be executed first or vice versa i.e. the earlier part of the code can be run simultaneously with the later part
0
that is okay but can you write that default code with thread.sleep function . I need to see how and where to implement it