Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Q:What ensures that each thread prints 500 times and does not interfere with the other?
- A:The various stacks that each thread maintains ensures that they will always know their progress
- Q:When does each thread end?
- A:Ends at 500
- Q:When does the program end?
- A:Ends when the main method thread ends and garbage collected
- Q:Is t1.start() blocking? IE: does the main thread wait for t1 to complete before moving on to other code?
- A:Nope, it’s asynchronous!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement