recursion we have seen that repetition can be achieved by writing loopssuch as for loops and while loops another way to achieve repetition is through recursionwhich occurs when function calls itself we have seen examples of methods calling other methodsso it should come as no surprise that most modern programming languagesincluding javaallow method to call itself in this sectionwe will see why this capability provides an elegant and powerful alternative for performing repetitive tasks the factorial function to illustrate recursionlet us begin with simple example of computing the value of the factorial function the factorial of positive integer ndenoted !is defined as the product of the integers from to if then nis defined as by convention more formallyfor any integer > for example * * * * to make the connection with methods clearerwe use the notation factorial(nto denote