OnJava8-Examples/interfaces/AnImplementation.java
2016-09-23 13:23:35 -06:00

23 lines
577 B
Java

// interfaces/AnImplementation.java
// (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
public class AnImplementation implements AnInterface {
public void firstMethod() {
System.out.println("firstMethod");
}
public void secondMethod() {
System.out.println("secondMethod");
}
public static void main(String[] args) {
AnInterface i = new AnImplementation();
i.firstMethod();
i.secondMethod();
}
}
/* Output:
firstMethod
secondMethod
*/