The Java Program: SimpleTemplate.java

  1 // An example Java program with static methods
  2 
  3 final class SimpleTemplate {
  4 
  5    static final short MAX = 256;       // constant
  6    static double variable;             // non-local variable
  7 
  8    public static void main (final String[] args) {
  9       return;
 10    }
 11 
 12    static int method1 (final char c) {
 13       final float local = 0.432f;       // local declaration
 14       final int i = Math.round (local); // (Can't leave off the "Math.")
 15       return -3;
 16    }
 17 
 18    static String method2 (final boolean b, final long l) {
 19       SimpleTemplate.variable = Double.parseDouble ("3.145");
 20       variable = Double.parseDouble ("3.145");
 21       return "xxx";
 22    }
 23 
 24 }