throw1 예외처리 예외 처리 try,catch using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { int iNumer; Console.Write("정수를 입력하세요: "); try // 예외 발생을 감시하는 구간 { iNumer = int.Parse(Console.ReadLine()); // 위코드에서 잘못된 입력시 프로그램을 중지하고, // 닷넷 프레임워크에서 예외 객체를 생성한다. // 생성된 예외 객체는 catch 문에 던져 준다. // 지금의 경우 FormatExceptio.. 2021. 6. 10. 이전 1 다음