Which statement is true?

Given:


Which statement is true?
A. Moveable can be used as below:
Moveable<Integer> animal = n – > System.out.println(“Running” + n);
animal.run(100);
animal.walk(20);
B. Moveable can be used as below:
Moveable<Integer> animal = n – > n + 10;
animal.run(100);
animal.walk(20);
C. Moveable can be used as below:
Moveable animal = (Integer n) – > System.out.println(n);
animal.run(100);
Moveable.walk(20);
D. Movable cannot be used in a lambda expression.

Download Printable PDF. VALID exam to help you PASS.

4 thoughts on “Which statement is true?

  1. A:
    Running100
    Walking

    B:
    incompatible types: bad return type in lambda expression
    int cannot be converted to void

    C:
    incompatible types: incompatible parameter types in lambda expression
    non-static method walk(Integer) cannot be referenced from a static context

    So yes, the answer is “A”

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.