Tag Archives: line

Given the code fragment: System.out.println(2 + 4 * 9 – 3); //Line 21 System.out.println((2 + 4) * 9

Given the code fragment:System.out.println(2 + 4 * 9 – 3); //Line 21 System.out.println((2 + 4) * 9 – 3); // Line 22 System.out.println(2 + (4 * 9) – 3); // Line 23 System.out.println(2 + 4 * (9 – 3)); // Line 24 System.out.println((2 + 4 * 9) – 3); // Line 25Which line of codes prints the highest… Read More »

Given: (Exhibit) What must be added in line 1 to compile this class?

Given:What must be added in line 1 to compile this class? A. catch(FileNotFoundException | IOException e) { } B. catch(IndexOutOfBoundsException e) { }catch(FileNotFoundException e) { } C. catch(FileNotFoundException e) { }catch(IndexOutOfBoundsException e) { } D. catch(IOException e) { } E. catch(FileNotFoundException | IndexOutOfBoundsException e) { } Correct Answer: D

Given: (Exhibit) Which statement is equivalent to line 1?

Given:Which statement is equivalent to line 1? A. double totalSalary = list.stream().map(e > e.getSalary() * ratio).reduce (bo).ifPresent (p > p.doubleValue()); B. double totalSalary = list.stream().mapToDouble(e > e.getSalary() * ratio).sum; C. double totalSalary = list.stream().map(Employee::getSalary * ratio).reduce (bo).orElse(0.0); D. double totalSalary = list.stream().mapToDouble(e > e.getSalary() * ratio).reduce(starts, bo); Correct Answer: C

Given: (Exhibit) Which statement is equivalent to line 1?

Given:Which statement is equivalent to line 1? A. double totalSalary = list.stream().map(e -> e.getSalary() * ratio).reduce (bo).ifPresent (p -> p.doubleValue()); B. double totalSalary = list.stream().mapToDouble(e -> e.getSalary() * ratio).sum; C. double totalSalary = list.stream().map(Employee::getSalary * ratio).reduce (bo).orElse(0.0); D. double totalSalary = list.stream().mapToDouble(e -> e.getSalary() * ratio).reduce(starts, bo); Correct Answer: C