Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using super keyword

 
Roger Fed
Ranch Hand
Posts: 82
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There shouldn't be any problem. Can you show exactly how and where you wrote it ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic