Which of the following statements about interfaces is true?
Blog
Consider the Counter class below. public class Counter { p…
Consider the Counter class below. public class Counter { public int count = 0; public int getCount() { return count; } public void increment() { count++; } } Using the class above and the variables declared below, what is the value of num1.equals(num2)? Counter num1 = new Counter(); Counter num2 = num1;
Consider the sort method shown below for selection sort: pub…
Consider the sort method shown below for selection sort: public static void sort(int[] a) { for (int i = 0; i < a.length – 1; i++) { int minPos = minimumPosition(i); swap(minPos, i); } } Suppose we modify the loop condition to read i < a.length. What would be the result?
Insert the missing code in the following code fragment. This…
Insert the missing code in the following code fragment. This fragment is intended to read an input file named dataIn.txt. public static void main(String[] args) __________________ { String inputFileName = “dataIn.txt”; File inputFile = new File(inputFileName); Scanner in = new Scanner(inputFile); . . . }
Which method can a program use to set the selected choice in…
Which method can a program use to set the selected choice in a JRadioButton?
Which of the following statements about exception reporting…
Which of the following statements about exception reporting is true?
Which of the following statements about interfaces is true?
Which of the following statements about interfaces is true?
In big-Oh notation, suppose an algorithm requires an order o…
In big-Oh notation, suppose an algorithm requires an order of n3 element visits. How does doubling the number of elements affect the number of visits?
Complete the code for the calcPower recursive method shown b…
Complete the code for the calcPower recursive method shown below, which is intended to raise the base number passed into the method to the exponent power passed into the method: public static int calcPower(int baseNum, int exponent) { int answer = 0; ________________________ { answer = 1; } else { answer = baseNum * calcPower (baseNum, exponent – 1); } return answer; }
What is the general order of a pull-down menu (from top-leve…
What is the general order of a pull-down menu (from top-level going downwards)?