Co Co: U-Trac U-Trac

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

h a n g e Vi h a n g e Vi

XC e XC e
F- w F- w
PD

PD
er

er
!

!
W

W
O

O
N

N
y

y
bu

bu
9.1) It fails to compile because it refers to title, a private
to

to
k

k
lic

lic
String, when it should refer to a method like getTitle that returns the
C

C
w

w
m

m
w w
w

w
o

o
.d o .c .d o .c
c u -tr a c k c u -tr a c k
title.
9.2) I predicted Item's would execute, but CD or DVD's did. It
seems the subclasses methods take precident over the superclass methods.
9.3) Though it works as expected, using this solution means that
the output of print from the superclass cannot be changed in any way, so
if CD or DVD need the print method to display different information, or
format it differently, it's almost impossible.
9.4) Ok
9.5) It has no parameters, but returns a String.
9.6) Using toString on DVD returned DVD@147c1db
9.7 - 9.8) see attatched dome-v2
9.12) getName must be part of the Device method.
9.13) The one in the subclass.
9.14) s will contain the word Student, and the memory adress of
st,
9.15) Yes it will, and it will print out the memory adress of st,
because of casting.
9.16)

You might also like