-1
Good afternoon!
Guys, I’m a beginner and I wanted to know how to simulate a bank transfer (Account + Conta2), being "Conta2" a class created outside the Class "Account".
I made the Withdraw and Deposit methods within the "Account Class".
My code is like this:
public class Conta {
String nome; String numero; double saldo;
public void Depositar(double NovoValor) {
if (NovoValor > 0) this.saldo = this.saldo + NovoValor; }
public void Sacar(double NovoSaque) {
if (this.saldo > NovoSaque) this.saldo = this.saldo - NovoSaque;
}
}
As you are beginning I will ask before giving my answer, you have already read about static methods?
– X4vier
Not yet, I’m on the 1° facul, this is an exercise and it’s as far as I can get with what I know so far.
– Mateus