Correct Answer: 32
Explanation:
Note: This Question is unanswered, help us to find answer for this one
Java Skill Assessment
Your Skill Level: Poor
Retake Quizzes to improve it
More Java MCQ Questions
Which of the following components allow multiple selections?
All Applets must import java.applet and java.awt.
Which method is called only once during the run time of your applet?
To determine the width and height of an application, which of the following method is used?
Java.applet defines how many interfaces?
The code below is supposed to find the maximum value of array {6,15,2,5,8,14,10,16,11,17,13,7,1,18,3,4,9,12}. How can the code be substantially improved, if at all? public static intmaxOfArray(int[] a) { int length = a.length; if(length<1) throw new NoSuchElementException('Not at least one integer in array'); while (length > 1) { int k = length; for(inti = 0; i< length/2; i++) { k--; if(a[i]>a[k]) { int j = a[i]; a[i] = a[k]; a[k] = j; } } length /=2; } return a[0]; }
How can the string '1 2 3 3 4 4 5 1' be added to an ArrayList where each number separated by a space is added as a separate list item, and the list cannot have duplicates?
The method foo() defined in the class Quiz has the following signature: public static double foo(double f) What can be said about foo()?
Output of the following code? public class Test extends Thread { private int value; public Test(int value) { this.value = value; } public static void main(String[] args) { Test t1 = new Test(1); Test t2 = new Test(2); Test t3 = new Test(3); t1.start(); t2.start(); t3.start(); } @Override public void run() { for (inti = 0; i< 3; i++) { System.out.println('Thread ' + value + ' with value ' + i + ' Started'); try { sleep(100); } catch (InterruptedException ex) { Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex); } System.out.println('Thread ' + value + ' with value '+ i + ' Completed'); } } }
Correct way to make the Jframevisiable always on top of other windows ?