• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Keyword Super

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
If someone can explain to me the meaning of word super in Java?
I'm confused of this word
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Super is used to refer to something in the superclass. Either a method or a variable.
produces:
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike Curwen gave an excellent example.
Here's a graphical representation:

So, if I were writing the Subclass1 code, and I wanted to refer to a variable or method from the Superclass, I would refer to them as super.variable or super.method().
This is exactly what Mike did with the line:
System.out.println("Value in SuperClass: " + super.value);
Susan

[This message has been edited by Susan Delph (edited May 22, 2001).]
 
    Bookmark Topic Watch Topic
  • New Topic