Answers for "one try with multiple catch in c#"

C#
1

c# try catch multiple catches

try
            {
                Console.WriteLine("Chose a number: ");
                int usrNo = Convert.ToInt32(Console.ReadLine());
                return usrNo;
            }
            catch (FormatException ex) 
            { 
              ErrorMessagePrintCustomMessage("You pressed a letter"); 
            }
            catch (Exception ex) { ErrorMessageErrorOccured(ex); }
Posted by: Guest on April-19-2021

C# Answers by Framework

Browse Popular Code Answers by Language