Exception throws : Exception Throw : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » Exception Throw »

 

Exception throws









    

/*
Learning C# 
by Jesse Liberty

Publisher: O'Reilly 
ISBN: 0596003765
*/

 using System;

 namespace ExceptionHandling
 {
    public class TesterExceptionHandling1
    {

       static void Main()
       {
           Console.WriteLine("Enter Main...");
           TesterExceptionHandling1 t = new TesterExceptionHandling1();
           t.Run();
           Console.WriteLine("Exit Main...");
       }
       public void Run()
       {
           Console.WriteLine("Enter Run...");
           Func1();
           Console.WriteLine("Exit Run...");
       }

        public void Func1()
        {
            Console.WriteLine("Enter Func1...");
            Func2();
            Console.WriteLine("Exit Func1...");
        }

        public void Func2()
        {
            Console.WriteLine("Enter Func2...");
            throw new System.Exception();
            Console.WriteLine("Exit Func2...");
        }

    }
 }

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» Exception Throw