0
Hello, then, I’m starting in java and would like to better understand what is .this. I imagine it has something to do with the current class or something like that. But I’m not sure. I’ll post a part of my code that . this is contained
class Conta {
int numero;
String dono;
double saldo;
double limite;
// Os metodos que ultilizam o .this
boolean saca(double valor) {
if (this.saldo < valor) {
return false;
}
else {
this.saldo = this.saldo - valor;
return true;
}
}
void deposita(double quantidade) {
this.saldo += quantidade;
}
}
Has public class also that is only giving value to the variables created in the Account class