Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package tp_3;
- public class GreenFerryPricing1 extends DefaultFerryPricing {
- public GreenFerryPricing1() {
- super();
- }
- int computePrice(Vehicle v) {
- return super.computePrice(v);
- }
- int computePrice(Car c) {
- if (c instanceof ElectricCar) {
- return super.computePrice(c) / 2;
- }
- return super.computePrice(c);
- }
- int computePrice(Bike b); {
- return super.computePrice(b);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement