Daniel Santos
JCHJava Community | Help. Code. Learn.
•Created by Roasty on 11/18/2024 in #java-help
Math in Java. What a struggle. Help. Please. Fast.
in representing decimal values use BigDecimal. primitive types cause precision and rounding problemsd
8 replies
JCHJava Community | Help. Code. Learn.
•Created by OMIDD on 10/11/2024 in #java-help
recursion
In a recursive method there are two parts : the recursive part where the method calls itself, and the stopping condition, where the recursion stops and the current call returns the value. In your example you have the recursive part where if the sum is bigger than zero you call the method with a value that tends to the stopping condition which is being equal to zero. When that condition is reached in one recursive call, the method returns and so on until the original caller is reached and you have the result. hope it helps
13 replies