Created
March 19, 2019 17:53
-
-
Save Marlysson/6c1be99f6bdb0fd85e9435e386ead097 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ContaCorrente{ | |
private String agencia; | |
private String conta; | |
private String correntista; | |
private double saldo; | |
// getters and setters | |
public void sacar(long valor){ | |
if ( this.saldo > valor ){ | |
this.saldo -= valor; | |
}else{ | |
system.out.println("Não possui saldo suficiente"); | |
} | |
} | |
} | |
class Teste{ | |
public static void main(String[] args){ | |
ContaCorrente conta = new ContaCorrente(); | |
conta.sacar(100); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment