Trace3 Examples ------------------------------------------------- // Example 1 public class Main { public static void main(String[] args) { int x = 3; f(x); { public static void f(int a) { System.out.println(2 * a + 1); } ------------------------------------------------- // Example 2 public class Main { public static void main(String[] args) { f(0); f(3); f(5); } public static void f(int a) { int s = 5; s += 2 * a; System.out.println(a + " " + s); } } ------------------------------------------------- // Example 3 public class Main { public static void main(String[] args) { int x, y; x = 1; y = f(x + 2); System.out.println(y - 1); } public static int f(int a) { int s, t; t = 2 * a + 1; s = 3 * t + a; return s / 2; } } ------------------------------------------------- // Example 4 public class Main { public static void main(String[] args) { System.out.println(f(0)); System.out.println(f(3)); System.out.println(f(5)); } public static int f(int a) { int s; s = a * (a + 3) - 4; return s; } } ------------------------------------------------- // Example 5: public class Main { public static void main(String[] args) { String x = "jewel"; System.out.println("$AB" + f(x) + "Z)"); } public static String f(String a) { return "&" + a.toUpperCase() + "%"; }