OverflowException থ্রো হয় যখন একটি মান টার্গেট টাইপের রেঞ্জের বাইরে চলে যায় (যেমন int.Parse এ খুব বড় স্ট্রিং)।
উদাহরণ
using System;
class Demo
{
static void Main()
{
string str = "757657657657657";
int res = int.Parse(str); // OverflowException
}
}
আউটপুট (এরর)
Unhandled Exception: System.OverflowException: Value was either too large or too small for an Int32.
প্রিভেনশন: long.Parse, BigInteger, বা int.TryParse ব্যবহার করুন। checked/unchecked কনটেক্সট কন্ট্রোল করে।