using System;
class Bank
{
private int bankid;
private string name;
public string Name
get{return name;}
set{if(!string.IsNullOrEmpty(value))
name= value;
}
else
throw new Exception();
public int BankId
get{return bankid;}
set
if(value<0)
throw new Exception("Invalid Id");
bankid=value;
public class Program
public static void Main()
Bank b=new Bank();
try
b.BankId=-500;
catch(Exception)
Console.WriteLine("-ve value found");
b.Name=null;
finally
Console.WriteLine("Id:" +b.BankId);
Console.WriteLine("name: " +b.Name);