Exception1 [C#]강제로 예외던지기(throw) using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp11 { class Program { static void Dosomething(int n) { if (n < 10) Console.WriteLine($"{n}"); else throw new Exception("n이 10보다 큽니다"); //강제로 예외던지기(throw) } static void Main(string[] args) { try { Dosomething(1); Dosomething(5); Dosomethi.. 2020. 6. 12. 이전 1 다음