Which code fragment, when inserted at line n1, enables the Birdie class to compile?

Given:


Which code fragment, when inserted at line n1, enables the Birdie class to compile?
A. static void fly (Consumer<Bird> bird) {
bird :: fly ();
}
B. static void fly (Consumer<? extends Bird> bird) {
bird.accept( ) fly ();
}
C. static void fly (Supplier<Bird> bird) {
bird.get( ) fly ();
}
D. static void fly (Supplier<? extends Bird> bird) {
LOST

Download Printable PDF. VALID exam to help you PASS.

3 thoughts on “Which code fragment, when inserted at line n1, enables the Birdie class to compile?

  1. Both C and D compile if we assume that “LOST” in D is error.

    What is a matter with this site?
    Last 20 question contains more typos than I’ve ever seen.
    Somebody got tired while posting previous 140 questions?

Leave a Reply

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


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