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
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?
C
C