I am implementing inheritance of something called Contexts. Each Context holds a link to its parent context. If that Context is the root Context, its parent is null.In order to walk up the inheritance tree and get the data from each Context, I want to do this (in pseudocode)private Hashtable getDataAsMap() {    Hashtable map  =  this.parent != null  ?                            this.parent.getDataAsMap()  :                            new Hashtable();    // add my data    return map;}Is this recursion? I'm calling the same method, but on a different object. Does that still count? If not, what would you call it?
Is this an example of recursion?
java;recursion
Yes.  This satisfies the two criteria for a recursive algorithm:An algorithm that takes 1 or more parameters and calls itself with a simplified version of the parameter(s) andA base case that tells the algorithm where to stop recursing.However, this looks like an odd way to do this.  It keeps looking up the tree until finding a root node (a node with no parent), and then returns a new object that's not actually associated with any of the nodes.  The end result will be identical to saying return new Hashtable();, but slower.  Are you sure that's what you intended?