Tuesday, 1 October 2019

C# Concept of using Exception_1

C# Concept of using Exception_1
using System;
namespace ConsoleApplicationSample
{
    class ArrayBCA
    {
#region Exception1
        static void Main()
        {
            try
            {
                int val = 100;
                int div = 0;
                int resultVal;
                resultVal = (val / div);
                Console.WriteLine("The result is  : " + resultVal);
            }
            catch (System.Exception ex)
            {
                Console.WriteLine("Exception catch here - details  : " + ex.ToString());
            }
            finally
            {
                Console.WriteLine("Enter finally block ");
                Console.ReadLine();
            }
        }
        #endregion
       }       
    }
}
https://www.youtube.com/channel/UCKLRUr6U5OFeu7FLOpQ-FSw/videos

0 comments

Post a Comment