problem of finding Relationship in Java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

problem of finding Relationship in Java

whats the relashon ship between these classes in java (Student class, Undergraduate class, Postgraduate class,)

2nd Apr 2021, 11:37 AM
Fancy
Fancy - avatar
2 Answers
+ 3
// Possible combination // but not if Undergraduate contains methods that should not be accessible in Postgraduate, only if they were rewritten class Student { String name; } class Undergraduate extends Student { String thesisTopic; } class Postgraduate extends Undergraduate { String doctoralThesis; }
2nd Apr 2021, 5:19 PM
zemiak
+ 1
will actully that was helpful thank you for answering my Question
2nd Apr 2021, 5:12 PM
Fancy
Fancy - avatar