For your factorial code why didn't you use static methods for Iterative and Recursion methods. This will help not create a new instance on your code which adds memory on your heap memory.
Instead you will directly call the methods when JVM calls the main method
For your factorial code why didn't you use static methods for Iterative and Recursion methods. This will help not create a new instance on your code which adds memory on your heap memory.
Instead you will directly call the methods when JVM calls the main method