Arslan777
Badges: 0
Rep:
?
#1
Report Thread starter 8 years ago
#1
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)
0
reply
Arslan777
Badges: 0
Rep:
?
#2
Report Thread starter 8 years ago
#2
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?
1
reply
Planto
Badges: 16
Rep:
?
#3
Report 8 years ago
#3
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.
0
reply
Fallen
Badges: 17
Rep:
?
#4
Report 8 years ago
#4
Spoiler:
Show
0
reply
Arslan777
Badges: 0
Rep:
?
#5
Report Thread starter 8 years ago
#5
Cheers guys thanks for the help
and that visual uml drawing also made it far easier to understand
Thanks!!
0
reply
Fallen
Badges: 17
Rep:
?
#6
Report 8 years ago
#6
(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.
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

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.

Personalise

University open days

  • Bournemouth University
    Midwifery Open Day at Portsmouth Campus Undergraduate
    Wed, 16 Oct '19
  • Teesside University
    All faculties open Undergraduate
    Wed, 16 Oct '19
  • University of the Arts London
    London College of Fashion – Cordwainers Footwear and Bags & Accessories Undergraduate
    Wed, 16 Oct '19

How has the start of this academic year been for you?

Loving it - gonna be a great year (110)
17.92%
It's just nice to be back! (166)
27.04%
Not great so far... (221)
35.99%
I want to drop out! (117)
19.06%

Watched Threads

View All