exam questions

Exam 1z0-809 All Questions

View all questions & answers for the 1z0-809 exam

Exam 1z0-809 topic 1 question 43 discussion

Actual exam question from Oracle's 1z0-809
Question #: 43
Topic #: 1
[All 1z0-809 Questions]

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?

  • A. Car auto = Car ("MyCar"): : new;
  • B. Car auto = Car : : new; Car vehicle = auto : : getCar("MyCar");
  • C. Rideable rider = Car : : new; Car vehicle = rider.getCar("MyCar");
  • D. Car vehicle = Rideable : : new : : getCar("MyCar");
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
6c84cb9
5 months, 4 weeks ago
C is the correct answer
upvoted 1 times
...
DarGrin
8 months, 1 week ago
Why does it work? Rideable rider = Car::new; Class Car doesn't implement Interface Rideable! Can somebody explain it please
upvoted 1 times
Syyyyyyyy
8 months, 1 week ago
Rideable is a FunctionalInterface. Rideable rider = Car::new, assigns Car::new as rider's getCar() method. So when you call rider.getCar() you are calling Car::new.
upvoted 1 times
...
...
asdfjhfgjuaDCV
11 months ago
C is the correct answer
upvoted 1 times
...
r1muka5
1 year, 10 months ago
Answer is C
upvoted 1 times
...
WilsonKKerll
2 years, 10 months ago
Answer is C.
upvoted 1 times
...
M_Jawad
5 years ago
C is the Correct Answer
upvoted 4 times
...
adnano1234
5 years ago
True...The interface must be functional
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago