Correzione numeroContoCorrente
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
package mybank;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -17,14 +18,21 @@ public class ContoCorrente {
|
||||
private Date dataDiNascita;
|
||||
private double saldoIniziale;
|
||||
private int numeroContoCorrente;
|
||||
private static int numeroContoCorrenteGlobale;
|
||||
|
||||
public ContoCorrente(String nome, String cognome, String codiceFiscale, Date dataDiNascita, double saldoIniziale) {
|
||||
private static ArrayList<Integer> numeriContiCorrenti = new ArrayList<>();
|
||||
|
||||
public ContoCorrente(String nome, String cognome, String codiceFiscale, Date dataDiNascita, double saldoIniziale,
|
||||
int numeroContoCorrente) {
|
||||
this.nome = nome;
|
||||
this.cognome = cognome;
|
||||
this.codiceFiscale = codiceFiscale;
|
||||
this.dataDiNascita = dataDiNascita;
|
||||
this.saldoIniziale = saldoIniziale;
|
||||
this.numeroContoCorrente = ++numeroContoCorrenteGlobale;
|
||||
this.numeroContoCorrente = numeroContoCorrente;
|
||||
numeriContiCorrenti.add(numeroContoCorrente);
|
||||
}
|
||||
|
||||
public static ArrayList<Integer> getNumeriContiCorrenti() {
|
||||
return numeriContiCorrenti;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user