Java examples for Object Oriented Design:Method
Illustrating the function call stack
public class Main { static double G(double x) { double result; result = Math.pow(x, 2.5); return result; }/* ww w.j a v a2 s.c o m*/ static double F(double x) { double result; result = 1.0 + G(x * x); return result; } public static void main(String[] args) { double y; y = F(5.0); System.out.println("y=" + y); } }