DRAG DROP Given: Runnable r = new Runnable() { public void run() { try { Thread.sleep(1000); } catch (interruptedException e) { System.out.println("interrupted"); } System.out.println("ran"); } }; Thread t = new Thread(r); t.start(); System.out.println("started"); t.sleep(2000); System.out.println("interrupting"); t.interrupt(); System.out.println("ended"); Assue that sleep(n)…

DRAG DROP Place the code elements in positions so that the Flags2 class will compile and make appropriate use of the wait/notify mechanism. Note: You may reuse code elements. Select and Place:

DRAG DROP Place the correct description of the compiler output on the code fragments to be inserted at lines 4 and 5. The same compiler output may be used more than once. 01. import java.util.*; 02. public class X {…

DRAG DROP Given: class A { String name = "A"; String getName() { return name; } String greeting() { return "class A"; } } class B extends A { String name = "B"; String greeting() { return "class B"; }…