Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 3 Forum
Date: Fri Sep 28 2001 11:35 am
Author: Danish, Matt R. <mrd@cmu.edu>
Subject: Re: recursive

is recursive depends on whether the child instance inherits this same implmentation of Blah() or not. There isn't enough of the code here to know for sure, but it certainly could be recursive because of inheritance. (For those of you who are still fuzzy on inheritance, just hold on --- we'll be spending more lecture time on this concept.)

Jason does mention that the child instance is of the same class as the current instance, so they would share the same implementation, presumably.

As for tail-recursion, it turns out that Matt is not quite right about Java. Matt hinted that tail-recursive method calls can be implemented as direct goto's. While this is true for many languages, it is expressly disallowed in Java, for security reasons. The java 2 security manager requires the presence of all stack frames for all methods to appear on the run-time stack.

This is good to know, I really didn't get around to testing this thoroughly. I'll stick to iteration constructs, then. Also, I know that you lose the stack frame information but I'm curious as to how this is a security issue.

Post response

Go to the previous messageGo to the following message
Current Thread Detail:
recursive      Cipriani, Jason A.      Thu Sep 27 2001 9:55 am       
Re: recursive      White, David      Thu Sep 27 2001 12:08 pm       
Re: recursive      Yuen, John      Thu Sep 27 2001 12:15 pm       
Re: recursive      Danish, Matt R.      Thu Sep 27 2001 12:42 pm       
Re: recursive      Cipriani, Jason A.      Thu Sep 27 2001 4:16 pm       
Re: recursive      Danish, Matt R.      Thu Sep 27 2001 7:38 pm       
Re: recursive      Lee, Peter      Fri Sep 28 2001 9:44 am       
Re: recursive      Danish, Matt R.      Fri Sep 28 2001 11:35 am       
Re: recursive      Lee, Peter      Fri Sep 28 2001 12:43 pm       

Back to previous screen