Explain the purpose of yield() method.
- The yield() method causes the currently executing thread object to temporarily pause and allow other threads to execute.
- This method causes on the currently executing thread object to temporarily pause and allow other threads to execute.
Declaration of yield() method:public static void yield()