Migliorata data
This commit is contained in:
@@ -11,7 +11,7 @@ import veicoli.VeicoloAMotore;
|
||||
* @author Verde
|
||||
*/
|
||||
public class Garage {
|
||||
public static final int DIMENSIONE_GARAGE = 2;
|
||||
public static final int DIMENSIONE_GARAGE = 15;
|
||||
VeicoloAMotore[] veicoli = new VeicoloAMotore[DIMENSIONE_GARAGE];
|
||||
|
||||
public int immettiNuovoVeicolo(VeicoloAMotore v) throws ArrayIndexOutOfBoundsException {
|
||||
|
||||
@@ -83,8 +83,6 @@ public class MainGarage {
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
|
||||
Date annoImmatricolazioneDate;
|
||||
String[] data;
|
||||
String anno;
|
||||
boolean error;
|
||||
Date now = new Date();
|
||||
String scelta;
|
||||
@@ -105,9 +103,7 @@ public class MainGarage {
|
||||
pausa();
|
||||
error = true;
|
||||
} else {
|
||||
data = annoImmatricolazioneDate.toString().split("\\s");
|
||||
anno = data[data.length - 1];
|
||||
annoImmatricolazione = Integer.parseInt(anno);
|
||||
annoImmatricolazione = Integer.parseInt(sdf.format(annoImmatricolazioneDate));
|
||||
}
|
||||
} catch (ParseException _) {
|
||||
System.out.println("Errore nella lettura della data.");
|
||||
|
||||
Reference in New Issue
Block a user