Skip to content

Instantly share code, notes, and snippets.

@CesarNog
Last active August 29, 2015 14:12
Show Gist options
  • Save CesarNog/ba23ece30000fccc0c3a to your computer and use it in GitHub Desktop.
Save CesarNog/ba23ece30000fccc0c3a to your computer and use it in GitHub Desktop.
public class TestMultipleHeritance {
interface Client {
default BigDecimal calculate(BigDecimal value) {
return value.multiply(new BigDecimal(10)).divide(new BigDecimal(100));
}
}
interface Sing {
default void sing() {
System.out.println("I like to sing...");
}
}
class Person implements Client, Sing {
}
@Test
public void test() {
Person person = new Person();
System.out.println(person.calculate(new BigDecimal(1500)));
person.sing();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment