This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes static,super&this Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "static,super&this" Watch "static,super&this" New topic
Author

static,super&this

geet
Greenhorn

Joined: Feb 04, 2002
Posts: 6
please do help me on static , this and super . correct me if i am wrong. super method in a subclass hold the value of it's(subclass) immediate superclass. static methods belong to a class ,what does this mean.i do have a rough idea. but please clear me on this.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63232
    
  69

geet, you'll be asked to change your name to the JavaRanch standards. Until then, in a nutshell:
this is a reference to the instance of the object that a non-static method is executing against.
super is a way to reference the superclass from which the current class is dervied. It could be used to differentiate between identifiers that are the same in the derived and super classes. When used as a method name in a constructor, it references the constructor of the superclass.
static is a keyword that specifies that a member or method does not "belong" to a specific instance of the class, but to the class as a whole. Hence, within a static method, there is no this.
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
geet
This the second time I have asked you to read and comply with our naming policy here at the ranch.
Your account has been locked.
Please re-register and make sure your display name is an appropriate name as shown in the policy.
[ March 13, 2002: Message edited by: Dave Vick ]

Dave
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: static,super&this
 
It's not a secret anymore!