Throw statement is very useful to handle exception in a program. Throwing exception handle by the catch block.
Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace what_is_through_statement_in_c_sharp
{
public class throw_statement //create class
{
public void devide(double x ,double y)//create function for division
{
double div;
try
{
if (y == 0)
{
throw new Exception("Can not Devide by Zero:\n");// throw Exception
}
div =Convert.ToDouble( x / y);


Join the conversation! Your thoughts help the community grow.