programming languages Online Quiz - 108
Description: programming languages Online Quiz - 108 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
A monitor called nik has 3 threads, having same priority, in its waiting pool; How can we notify one of the threads, named 'thread1' to move from Waiting state to Ready State?
What of the following fails to cause a thread stop executing ?
Which statement is true for the following code? public class Rpcraven { public static void main(String argv[]){ Pmcraven pm1 = new Pmcraven("one"); pm1.run(); Pmcraven pm2 = new Pmcraven("two"); pm2.run(); } } class Pmcraven extends Thread { private String sTname=""; Pmcraven(String s) { sTname = s; } public void run(){ for(int i =0; i < 2 ; i++){ try { sleep(1000); }catch(InterruptedException e){ } yield(); System.out.println(sTname); } } }
What will be the outcome of line no. 9 in the following program ? 1. public class SearchArray { 2. public static void main(String[] args) { 3. String[] strArr = {"one","two","three","four","five","six","seven"}; 4. boolean[] boolArr = {true,false,false,true,false}; 5. int[] intArr = {22,11,66,99}; 6. Arrays.sort(intArr); 7. for(int n=0; n