try中的程序块是有可能发生错误的程序块,catch中的程序块是当发生错误的时候才会执行的代码块,finally中的程序块是无论是否发生错误都会执行的代码块。
示例程序:
?
29using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Sample_01_CA
{
public class Complex
try中的程序块是有可能发生错误的程序块,catch中的程序块是当发生错误的时候才会执行的代码块,finally中的程序块是无论是否发生错误都会执行的代码块。
示例程序:
?
29using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Sample_01_CA
{
public class Complex