What is the result?

Given the code fragment:


What is the result?
A. Hello : Jim Hello : John Hello : Jeff
B. Jim John Jeff
C. The program prints nothing.
D. A compilation error occurs.

Download Printable PDF. VALID exam to help you PASS.

5 thoughts on “What is the result?

  1. class Testing {

    public static void main (String[] args){

    List nL = Arrays.asList(“Jim “, “John “, “Jeff”+”\n”);
    Function funVal = s -> “Hello : “.concat(s); nL.stream()
    .map(funVal)
    .forEach(s-> System.out.print (s));

    }

    }
    output:
    Hello : Jim Hello : John Hello : Jeff

Leave a Reply

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


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