Nice try. If i use '1000', the print method call '1000' times. In this time method parameter initialize more than time. Please compare with loop concept which is take more time.
Kindly post your code inside the code tag.
A simple way to illustrate the recursion and the very nice explanation by the moderator too why not efficient.
A suggestion, if in the worst case this approach is required to be used, the class "recurs" should be taken as singleton one, so that at least the same object may not get created everytime.
Kindly correct me if not appropriate.
Puneet Sharma - Infosys
i m agree wid your response but this code is example of recursion method simply you have to know how the recursion works thts why i m only gives example to print 1-100 digit.....
if u r print 1000 time thats is worst case for this program........