Skip to content

Instantly share code, notes, and snippets.

@Marlysson
Created March 19, 2019 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Marlysson/6c1be99f6bdb0fd85e9435e386ead097 to your computer and use it in GitHub Desktop.
Save Marlysson/6c1be99f6bdb0fd85e9435e386ead097 to your computer and use it in GitHub Desktop.
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