Thread.sleep() versus wait()
QuizMediumJava onlyAsked in: Accenture, Capgemini, Cognizant, Infosys, TCS
Which statements are true? Pick all that apply.
Thread.sleep(ms)pauses the current thread and keeps any locks it holdsobj.wait()releases the lock on obj while waitingwait()can be called anywhere without holding the lockThread.sleepis a good way to wait for a page element
This question is part of Pro+
Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.