#Question about inheritance

11 messages · Page 1 of 1 (latest)

signal jacinth
#

Given the following Java source code:

O o = new O();
X x = new X();
T t = new T () ;
M m = new M () ;

The following assignments are all LEGAL (they can be translated):

m = t m = x o =t:

The following assignments are all ILLEGAL (they lead to translation errors):

o = m; o = x x = o ;

Question: What are the inheritance relationships between these classes?

fading micaBOT
#

This post has been reserved for your question.

Hey @signal jacinth! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

lethal oracle
#

What are your thoughts and why do you have difficulties with it?

signal jacinth
short fossil
#

alert: i might be retarded

#

O extends M, T extends O

#

disregard everything

#
  M
 / \
O   X
|
T
#

(deleted the previous solution i posted because it was wrong)