If you get caught, you have to wake up with notify or notify all in other threads And sleep stops for a certain amount of time. It's a static method, so you can use it without having to use a thread object The wait should only be used within the synchronization block.
© 2024 OneMinuteCode. All rights reserved.