/* Listing1003.java */ public class Listing1003 { public static void printTable(DoubleMethod meth) { System.out.println("Wertetabelle " + meth.toString()); for (double x = 0.0; x <= 5.0; x += 1) { System.out.println(" " + x + "->" + meth.compute(x)); } } public static void main(String[] args) { printTable( new DoubleMethod() { public double compute(double value) { return Math.sqrt(value); } } ); } }