nerdexam
Oracle

1Z0-809 · Question #273

class Bird { String name; Bird(String name) { this.name = name; } public void eat () { System.out.println(name + " is eating"); } } interface BirdInt { Bird getBird(String name); } public class App…

The correct answer is B. BirdInt b1 = bird::new Bird b = b1.getBird("Peacock"). You've hit your session limit · resets 5:20pm (America/New_York)

Question

class Bird { String name; Bird(String name) { this.name = name; } public void eat () { System.out.println(name + " is eating"); } } interface BirdInt { Bird getBird(String name); } public class App { public static void main (String[] args) { // insert code here b.eat(); } } Which code fragment can be inserted to print: Peacock is eating?

Options

  • ABirdInt b = new::Bird("Peacock");
  • BBirdInt b1 = bird::new Bird b = b1.getBird("Peacock");
  • CBirdInt b = new Bird ("Peacock");
  • DBird b = Bird::new("Peacock");

How the community answered

(53 responses)
  • A
    6% (3)
  • B
    81% (43)
  • C
    4% (2)
  • D
    9% (5)

Explanation

You've hit your session limit · resets 5:20pm (America/New_York)

Community Discussion

No community discussion yet for this question.

Full 1Z0-809 Practice