package org.example; public class SumCalculator { public static int sum(int n) { System.out.println("This is called by the executable"); // Base case: If n is 0, terminate if ( n == 0 ) { return 0; } // if // Recursive Case return n + sum(n - 1 ); } // sum() // main() run public static void main(String[] args) { int number = 5; // 15 int result = sum(number); System.out.println("Result: " + result); // 15 } // main } //SumCalculator