This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The present object. Not quite class value, but the object itself.
You can distinguish local variables (or parameters) from fields of the same name by prefixing the field's identifier with this. Example of constructor for a clock, which is similar to an example in Deitel and Deitel's book, and I have copied and pasted from a posting I wrote yesterday: The parameters hour minute second are distinguished from the fields of the same name because the fields have this.hour in.
Same snippet: note the constructor is overloaded; there are actually 4 constructors here, and you can call a constructor from another constructor by writing "this(something);". Note such a constructor call has to be the first line of the constructor.
You can send "this" as an argument to a method. If you set up an ObjectOutputStream for serialising, you can call "oos.writeObject(this);".
The keyword super refers to the immediate superclass, as you correctly said. If your superclass doesn't have an accessible no-argument constructor (or a default constructor added by the compiler), you must call the superclass' constructor with a "super(something);" call. The super call must be the first line in a constructor, so you can't use super() and this() in the same constructor, but you can use this() to lead control to a constructor with super() in. You can also call a superclass' method (if it is accessible) from anywhere in the subclass by writing . . . super.someMethod(something) . . . This call does not have to be the first line.
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