Use interface

master
Hammy 4 years ago
parent 3bf3458c82
commit bbbb324221

@ -0,0 +1,3 @@
public interface Equation {
void displayEquation();
}

@ -1,4 +1,4 @@
public class Line {
public class Line implements Equation {
private double gradient;
private double intercept;
@ -22,6 +22,7 @@ public class Line {
intercept = y1 - (gradient * x1);
}
@Override
public void displayEquation() {
System.out.println("y = " + gradient + "x + " + intercept);
}

Loading…
Cancel
Save