Exception handling in c#.net

preview_player
Показать описание
exception handling in c#.net,try,catch,finaly,throw
hen an exception is thrown, the common language runtime (CLR) looks for the catch statement that handles this exception. If the currently executing method does not contain such a catch block, the CLR looks at the method that called the current method, and so on up the call stack. If no catch block is found, then the CLR displays an unhandled exception message to the user and stops execution of the program
catch (InvalidCastException e)
{
if (e.Data == null)
{
throw;
}
else
{
// Take some action.
}
}
class ThrowTest3
{
static void ProcessString(string s)
{
if (s == null)
{
throw new ArgumentNullException();
}
}

static void Main()
{
try
{
string s = null;
ProcessString(s);
}
// Most specific:
catch (ArgumentNullException e)
{
Console.WriteLine("{0} First exception caught.", e);
}
// Least specific:
catch (Exception e)
{
Console.WriteLine("{0} Second exception caught.", e);
}
}
}
/*
Output:
System.ArgumentNullException: Value cannot be null.
at Test.ThrowTest3.ProcessString(String s) ... First exception caught.
*/
exception handling in c#.net,exception handling in c#.net in hindi,exception handling program in c sharp,how catch exception,how to make exception handling program in c sharp,how to create exception handling program in c#,c# exception handling,handling,exception,exception handling,exceptions,c#.net tutorial videos,exceptions and exception handling in c#.net,exceptions and exception handling,what is an exception,error handling,exception handling program in c#,program in c sharp,zero division error

-~-~~-~~~-~~-~-
Please watch: "How to buy a domain name from GoDaddy 2019"

How to make a calling app in android

How to create drawing android app in mit app inventor 2

How to make android calculator app using mit app

How to upload android app in google play store

how to create camera app in mit app inventor 2

How to create first android app in mit app inventor
................................................................................................

Follow Us On Social Media For More Updates -:

....................................................................................................
#USA The Coding Bus #unitedstates
#usa #TheCodingBus
#TCB #unitedstates #us
Рекомендации по теме