1z0-809 Exam Question 141

Given:
IntStream stream = IntStream.of (1,2,3);
IntFunction<Integer> inFu= x -> y -> x*y;//line n1
IntStream newStream = stream.map(inFu.apply(10));//line n2
newStream.forEach(System.out::print);
Which modification enables the code fragment to compile?
  • 1z0-809 Exam Question 142

    Given the code fragment:

    Which modification enables the code to print Price 5 New Price 4?
  • 1z0-809 Exam Question 143

    Given:
    public interface Moveable<Integer> {
    public default void walk (Integer distance) {System.out.println
    ( "Walking");)
    public void run(Integer distance);
    }
    Which statement is true?
  • 1z0-809 Exam Question 144

    Given the code fragment:

    and the information:
    * The required database driver is configured in the classpath.
    * The appropriate database is accessible with the dbURL, username, and passWord exists.
    What is the result?
  • 1z0-809 Exam Question 145

    Given:
    1 . abstract class Shape {
    2 . Shape ( ) { System.out.println ("Shape"); }
    3 . protected void area ( ) { System.out.println ("Shape"); }
    4 . }
    5 .
    6 . class Square extends Shape {
    7 . int side;
    8 . Square int side {
    9 . /* insert code here */
    1 0. this.side = side;
    1 1. }
    1 2. public void area ( ) { System.out.println ("Square"); }
    1 3. }
    1 4. class Rectangle extends Square {
    1 5. int len, br;
    1 6. Rectangle (int x, int y) {
    1 7. /* insert code here */
    1 8. len = x, br = y;
    1 9. }
    2 0. void area ( ) { System.out.println ("Rectangle"); }
    2 1. }
    Which two modifications enable the code to compile? (Choose two.)