Guest User

Untitled

a guest
Oct 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. package banco;
  2. public abstract class Conta {
  3.  
  4. private float saldo;
  5. protected void setSaldo(float valor) {
  6. this.saldo = valor;
  7. }
  8.  
  9.  
  10. public float getSaldo() {
  11. return this.saldo;
  12. }
  13.  
  14. public abstract void depositar(float valor);
  15.  
  16. public abstract void retirar(float valor);
  17.  
  18. public void transferirPara(Conta outraConta, float valor) throws Exception {
  19. this.retirar(valor);
  20. outraConta.depositar(valor);
  21. }
  22.  
  23. }
Add Comment
Please, Sign In to add comment