| Author |
Using super keyword
|
Roger Fed
Ranch Hand
Joined: Oct 17, 2010
Posts: 82
|
|
hello,
I've developed these two classes, they are related by inheritance
when the last line executed in main , i want the "toString()" in the subclass call the "toString()" in the super class
I've tried to put this line "super.toString()" inside the the method in the subclass but it give me syntax error
I'd be grateful if you help me
thanks in advance.
this is main
and this is the GeometricObject class
|
I Hear I Forget, I See I Remember, I Do I Understand.
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14670
|
|
|
There shouldn't be any problem. Can you show exactly how and where you wrote it ?
|
[My Blog]
All roads lead to JavaRanch
|
 |
 |
|
|
subject: Using super keyword
|
|
|