Guest User

Untitled

a guest
Apr 22nd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. public class X2 implements Function {//implements the interface Function
  2.     public double f(double x) {
  3.         return x*x-0.6;//returns the value of the function f(x)
  4.     }
  5.     public String toString() {
  6.         return "x^2 - 0.6";//returns the function as a string
  7.     }
  8. }
Add Comment
Please, Sign In to add comment