Skip to content

Issues in second solution of 0c21 #13

@hchoi2139

Description

@hchoi2139

The second solution says

Make interfaces Detached, SemiDetached, and Terraced. Keep Bungalow as an abstract class that extends House. Then have DetachedHouse extend House and implement Detached, and have DetachedBungalow extend Bungalow and implement Detached (the setup for the semi-detached and terraced property types is analogous). You might benefit from drawing a class diagram for this arrangement.

According to the solution above, TerracedBungalow is extending an abstract class Bungalow and implementing an interface Terraced while TerracedHouse is extending an abstract class House and implementing an interface Terraced.
Hence, TerracedBungalow isn't an instance of TerracedHouse while the question claims that TerracedBungalow 'is-a' TerracedHouse (since it says that PropertyCollection has 1020 terraced houses).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions