fix exception

This commit is contained in:
orange 2017-01-09 11:17:03 +01:00
parent b5dce92962
commit f51111ce43
2 changed files with 8 additions and 3 deletions

View File

@ -78,7 +78,7 @@ public class Persona{
peso=Double.parseDouble(sc.nextLine()); peso=Double.parseDouble(sc.nextLine());
} }
catch(NumberFormatException exception){ catch(NumberFormatException exception){
System.err.println("Impossibile convertire la stringa in data"); System.err.println("Impossibile convertire la stringa in double");
System.err.println("Peso impostato a 0"); System.err.println("Peso impostato a 0");
peso=0; peso=0;
} }
@ -87,7 +87,7 @@ public class Persona{
altezza=Double.parseDouble(sc.nextLine()); altezza=Double.parseDouble(sc.nextLine());
} }
catch(NumberFormatException exception){ catch(NumberFormatException exception){
System.err.println("Impossibile convertire la stringa in data"); System.err.println("Impossibile convertire la stringa in double");
System.err.println("altezza impostata a 0"); System.err.println("altezza impostata a 0");
altezza=0; altezza=0;
} }

View File

@ -17,4 +17,9 @@ Vincenzo
Manganiello Manganiello
04/09/2005 04/09/2005
40.7 40.7
146.9 146.9
Nome
Cognome
qw34/723
012
1j01