A method that calls itself is referred to be a recursive method in Java. And recursion is the name for this process.
A concrete example would be to align two parallel mirrors so that they are facing one another. Any object in their path would be recursively mirrored.
class Factorial {
static int factorial( int n ) {
if (n != 0) // termination condition
return n * factorial(n-1); // recursive call
else
return 1;
}
public static void main(String[] args) {
int number = 4, result;
result = factorial(number);
System.out.println(number + " factorial = " + result);
}
}
Learn more about recursion here-
https://brainly.com/question/20749341
#SPJ4