Hey there! Sign in to join this conversationNew here? Join for free
    • Thread Starter
    Offline

    0
    ReputationRep:
    Hi can any1 help me figure out the following inheritance digrams:

    Q) Draw an inheritance diagram that shows the inheritance relationships between the classes:

    Person
    Employee
    Student
    Instructor
    Classroom
    Object

    i know that inheritance design is an arrow with black head
    (abit hard to draw in here)
    • Thread Starter
    Offline

    0
    ReputationRep:
    I came up with the answer as:

    Classroom (superclass)

    An object "is a" classroom (going to extend to classroom)
    A student "is a" classroom ( going to extend to classroom)
    A student "is a" person ( going to entend to person)
    Person "is a" student ( going to extend to student)
    Employee "is a" person (going to extend to person)
    Instructor "is a" person (going to extend to person)

    i did draw them in uml way isnt easy to show here any1 let me know if am correct?
    Offline

    16
    ReputationRep:
    Is an object a type of classroom? Is a student a type of classroom? The idea of a subclass is that it is a more specific version of its superclass; for example, "crow" could be a subclass of "bird".

    Also, bear in mind that (in programming terms) an instance of any class is an "object", so all classes can generally be considered subclasses of the Object class.
    Offline

    15
    ReputationRep:
    Spoiler:
    Show
    • Thread Starter
    Offline

    0
    ReputationRep:
    Cheers guys thanks for the help
    and that visual uml drawing also made it far easier to understand
    Thanks!!
    Offline

    15
    ReputationRep:
    (Original post by Arslan777)
    Cheers guys thanks for the help
    and that visual uml drawing also made it far easier to understand
    Thanks!!
    If you are learning Java, a very good tool is BlueJ.

    It is a stripped down IDE for Java specifically made for people learning Java. It makes such diagrams automatically as your build your project.
    You would probably kill yourself if you had to do a serious project with it, but for simple things, and specifically for learning, it is great.
 
 
 
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • Poll
    Brexit voters: Do you stand by your vote?
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

    Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

    Write a reply...
    Reply
    Hide
    Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.