The parameter to the getValue method is a Base object reference. The Robinwood class extends Base, and when the keyword 'this' is used as the parameter to the getValue method, I am wondering if it is referring to 'the parentclass of which this class belongs' ?
BTW - In the code below, the second method 'main' (which i presume to be an overloaded name?) calls the method getValue. Now, the method getValue in the paentclass Base is abstract (and as such must have no body), and it is 'implemented' so to speak, in the Robinwood class by having a pair of curly braces added to it.
abstract class Base{
abstract public void getValue(Base b);
}
public class Robinwood extends Base{
public static void main(String argv[]){
Robinwood rw = new Robinwood();
rw.main();
}
public void main(){
getValue(this);
}
public void getValue(Base b){
}
}
BTW - In the code below, the second method 'main' (which i presume to be an overloaded name?) calls the method getValue. Now, the method getValue in the paentclass Base is abstract (and as such must have no body), and it is 'implemented' so to speak, in the Robinwood class by having a pair of curly braces added to it.
abstract class Base{
abstract public void getValue(Base b);
}
public class Robinwood extends Base{
public static void main(String argv[]){
Robinwood rw = new Robinwood();
rw.main();
}
public void main(){
getValue(this);
}
public void getValue(Base b){
}
}