Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

le Edit View History Bookmarks People Window Help Final Exam Secure https:llsisu

ID: 3841909 • Letter: L

Question

le Edit View History Bookmarks People Window Help Final Exam Secure https:llsisu.instructure.com/courses/1233754lquizzes /119799 8/take hool Mail M Gmail Google Docs On LinkedIn heBay C3Canvas I Soundcloud YouTube n sc conver We can control a thread's schedule by using arich set of lava methods, such as skeep0, yleld0Join0.setPriority0 walt0, notify0 and notityAl0. G True False Question 77 1 pts The following block of code creates a CopyonWriteArrayUst, adds elements to and prints the contents: CopyorinriteArrayList

Explanation / Answer

We can control thread shedule by using sleep() ,yield() ,join() ,setPriority() method,wait() ,notify() and notifyAll()

Ans) True

_______________________

CopyOnWriteArrayList<Integer> cowList = new CopyOnWriteArrayList<Integer>();
       cowList.add(4);
       cowList.add(2);
       Iterator<Integer> it=cowList.iterator();
       cowList.add(6);
       while(it.hasNext())
       {
           System.out.println(it.next()+" ");
       }
  

77)Ans) 4 2

__________________________Thank You