C#异常处理

C#异常处理

一 : catch 之后是否会跳出异常 答案:不会

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            int sum = 30;
            for (int i = 0; i < 30; i++)
            {
                try
                {
                    int r = sum / i;
                }
                catch(Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
    }
}
posted @ 2012-05-11 10:13  水目之痕  阅读(207)  评论(0)    收藏  举报