1public
2class ConstFunction
3 implements RealFunction
4{
5 private
6 double c;
7
8 public
9 ConstFunction(double c) {
10 this.c = c;
11 }
12
13 public
14 double at(double x) {
15 return
16 c;
17 }
18
19 public
20 String toString() {
21 return
22 "" + c;
23 }
24}
25