Advertisement
danzylrabago

FormatException

Mar 31st, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. using System;
  2.  
  3. class Program{
  4.  
  5. public static void Main(){
  6.  
  7. double num = 0;
  8. try{
  9. num = Convert.ToDouble("63.5@4");
  10. }
  11. catch (FormatException){
  12. Console.WriteLine("We encountered a FormatException");
  13. }
  14. catch (Exception){
  15. Console.WriteLine("Another Exception");
  16. throw; // rethrowing
  17. }
  18. Console.WriteLine(num);
  19. }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement