Whole program version:
public class TrivialApplication {
public static void main(String args[]) {
// Store 1 + 2 + 3 + 4 in s
// General picture: s= 0 + 1 + 2 + � + i-1.
System.out.println("i = " + i + " s = " + s);
try { System.in.read(); // prevent console window from going away
} catch (java.io.IOException e) {} }}