G
Guest
I am trying to intentionally cast a string value into an integer, such as the
text "Jack" into a Integer variable to generate the exception
InvalidCastException. This is for an excercize on generating exceptions.
However, the compiler is catching the would be mistake before i can run the
program in the first place so I am stuck.
Any ideas please.
text "Jack" into a Integer variable to generate the exception
InvalidCastException. This is for an excercize on generating exceptions.
However, the compiler is catching the would be mistake before i can run the
program in the first place so I am stuck.
Any ideas please.