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-808 Topic 17 Question 94 Discussion

Actual exam question for Oracle's 1Z0-808 exam
Question #: 94
Topic #: 17
[All 1Z0-808 Questions]

Given these requirements:

Bus and Boat are Vehicle type classes.

The start() and stop() methods perform common operations across the Vehicle class type.

The ride() method performs a unique operations for each type of Vehicle.

Which set of actions meets the requirements with optimized code?

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Ines
10 months ago
I'm just glad they didn't ask us to create a `Unicycle` class too. That would've been a real `balancing` act!
upvoted 0 times
Eliz
10 months ago
B) 1. Create an interface Vehicle by defining start() and stop() methods, and declaring the ride() abstract method. 2. Create Bus and Boat classes by implementing the Vehicle class.
upvoted 0 times
...
Marylyn
10 months ago
A) 1. Create an abstract class Vehicle by defining start() and stop() methods, and declaring the ride() abstract method. 2. Create Bus and Boat classes by inheriting the Vehicle class and overriding the ride() method.
upvoted 0 times
...
...
Kimberlie
11 months ago
I'd have to go with A as well. Defining an abstract class for the Vehicle type and letting the concrete classes handle the specific implementation is a great way to optimize the code.
upvoted 0 times
...
Cherelle
11 months ago
I agree, A is the way to go. Using an abstract class gives you the flexibility to add common functionality in the base class while still allowing for unique implementation in the derived classes.
upvoted 0 times
Dustin
10 months ago
C) 1. Create an abstract class Vehicle by declaring stop(), start(), and ride() abstract methods. 2. Create Bus and Boat classes by inheriting the Vehicle class and overriding all the methods.
upvoted 0 times
...
Hannah
10 months ago
I think B could work too. By using an interface, you can have multiple inheritance and still enforce the implementation of certain methods.
upvoted 0 times
...
Dorothy
10 months ago
A) 1. Create an abstract class Vehicle by defining start() and stop() methods, and declaring the ride() abstract method. 2. Create Bus and Boat classes by inheriting the Vehicle class and overriding the ride() method.
upvoted 0 times
...
...
Emilio
11 months ago
Option A seems the most logical choice here. Defining an abstract class for the common operations and letting the concrete classes handle the unique logic is a classic OOP pattern.
upvoted 0 times
Tricia
10 months ago
I think Option C is not as efficient as Option A. It's better to have a separate abstract class for common operations.
upvoted 0 times
...
Aleta
10 months ago
Option B could work too, but I think Option A is more optimized.
upvoted 0 times
...
Hyun
10 months ago
I agree, Option A is the best choice. It follows the classic OOP pattern.
upvoted 0 times
...
...
Sina
11 months ago
I agree with you, Novella. Option A seems to meet the requirements efficiently.
upvoted 0 times
...
Novella
11 months ago
I think option A is the best choice.
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