Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Oracle Exam 1Z0-809 Topic 2 Question 41 Discussion

Actual exam question for Oracle's 1Z0-809 exam
Question #: 41
Topic #: 2
[All 1Z0-809 Questions]

Given:

public final class IceCream {

public void prepare() {}

}

public class Cake {

public final void bake(int min, int temp) {}

public void mix() {}

}

public class Shop {

private Cake c = new Cake ();

private final double discount = 0.25;

public void makeReady () { c.bake(10, 120); }

}

public class Bread extends Cake {

public void bake(int minutes, int temperature) {}

public void addToppings() {}

}

Which statement is true?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Sherita
16 days ago
I'm not sure, but I think E) All classes compile successfully could also be a valid answer.
upvoted 0 times
...
Leonie
19 days ago
I think the answer is B. There's a compilation error in the `Cake` class because the `bake()` method is marked as `final`, so it can't be overridden in the `Bread` class.
upvoted 0 times
Bernardo
2 hours ago
I agree, the answer is B. The `final` keyword in the `bake()` method causes a compilation error in the `Cake` class.
upvoted 0 times
...
...
Benton
23 days ago
The correct answer is E. All classes compile successfully. The `prepare()` method in `IceCream` is public, so there's no compilation error. The `bake()` method in `Cake` is also valid, and `Shop` can create an instance of `Cake`. The `Bread` class extends `Cake`, so the `bake()` method overrides the one in `Cake`.
upvoted 0 times
...
Chauncey
25 days ago
I agree with Ilona, because the method signature in Bread does not match the one in Cake.
upvoted 0 times
...
Ilona
1 months ago
I think the answer is D) A compilation error occurs in Bread.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77