• Post Reply Bookmark Topic Watch Topic
  • New Topic

how a class can call methods using super  RSS feed

 
sham shalem
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends, if my application has 50 classes. All classes has method called display(), then how i can call the first class in 50 class using 'super'.
[ September 26, 2008: Message edited by: sham shalem ]
 
Rob Spoor
Sheriff
Posts: 21131
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can only go "up" one level. So if you have class A, class B extends A and class C extends B, then class C cannot "super" back to class A, only to B.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!