Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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