nerdexam
Oracle

1Z0-809 · Question #14

Given: interface Rideable { Car getCar (String name); } class Car { private String name; public Car (String name) { this.name = name; } } Which code fragment creates an instance of Car?

The correct answer is C. Rideable rider = Car ::new; Car vehicle = rider.getCar("MyCar"). You've hit your session limit · resets 5:20pm (America/New_York)

Question

Given: interface Rideable { Car getCar (String name); } class Car { private String name; public Car (String name) { this.name = name; } } Which code fragment creates an instance of Car?

Options

  • ACar auto = Car ("MyCar");::new;
  • BCar auto = Car ::new;
  • CRideable rider = Car ::new; Car vehicle = rider.getCar("MyCar");
  • DRideable = Rideable ::new ::getCar("MyCar");

How the community answered

(22 responses)
  • A
    9% (2)
  • B
    5% (1)
  • C
    77% (17)
  • D
    9% (2)

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