Как решить ожидаемый улов или финал
это мой код :
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ExceptionHandling { class Program { static void Main(string[] args) { double bil1, bil2, hasil = 0; try { Console.Write("Masukan Bilangan 1:"); bil1 = Convert.ToDouble(Console.ReadLine()); Console.Write("Masukan Bilangan 2:"); bil2 = Convert.ToDouble(Console.ReadLine()); hasil = bil1 / bil2; Console.WriteLine("Hasilnya :" + hasil.ToString()); } catch (FormatException fex) { Console.WriteLine("Error : Format Input tidak sesuai.."); } catch (Exception ex) { Console.WriteLine("Error : " + ex.Message); } byte nilai = 0; try { Console.Write("Masukan Nilai :"); nilai = Convert.ToByte(Console.ReadLine()); } catch (OverflowException ofex) { Console.WriteLine("Error : Tipe data tidak cukup menampung nilai"); } catch (Exception ex) { Console.WriteLine("Error :" + ex.Message); Lingkaran objLing = new Lingkaran(); try { Console.Write("Masukan diameter :"); objLing.Diameter = Convert.ToDouble(Console.ReadLine()); } } } } } What I have tried: help me.. How to solve expected catch or finaly my code
Christian Graus
Он ожидает общего catch или finally в конце, когда тип исключения неизвестен. Ошибка означает то, что она говорит :)