December 2018
Beginner to intermediate
668 pages
15h 30m
English
Modify the catch statement to look like this:
catch(Exception ex)
{
WriteLine($"{ex.GetType()} says {ex.Message}");
}
Run the console application and again enter an invalid age, for example, kermit:
Before parsing What is your age? kermit System.FormatException says Input string was not in a correct format. After parsing
Read now
Unlock full access