Skip to content

Instantly share code, notes, and snippets.

@CesarNog
Last active August 29, 2015 14:12
Show Gist options
  • Save CesarNog/e06a28849b09d448f0b0 to your computer and use it in GitHub Desktop.
Save CesarNog/e06a28849b09d448f0b0 to your computer and use it in GitHub Desktop.
public class TesteHerancaMultipla {
interface Cliente {
default BigDecimal calcular(BigDecimal valor) {
return valor.multiply(new BigDecimal(10)).divide(new BigDecimal(100));
}
}
public interface Cantar {
default void cantar() {
System.out.println(“Gosto de cantar la la la…”);
}
}
public class Pessoa implements Cliente, Cantar {
}
@Test
public void teste() {
Pessoa pessoa = new Pessoa();
System.out.println(pessoa.calcular(new BigDecimal(1500)));
pessoa.cantar();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment