Posted by: shresthasubash April 26, 2009
c# help
Login in to Rate this Post:     0       ?        
using System;
using System.Collections.Generic;
using System.Text;

namespace SajhaUser
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Employee emp = new Employee(1, 56);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.ReadLine();
            }
                
        }
    }
}
using System;
using System.Collections.Generic;
using System.Text;

namespace SajhaUser
{
    public class Employee
    {
        private int idNumber = 0;
        private double wages = 0.00;
        public Employee(int id, double salary)
        {
            if (salary < 6 || salary > 50)
                throw new ArgumentException("Not valid number");
            else

            this.wages = salary;
            this.idNumber = id;
        }
       
    }
}

Read Full Discussion Thread for this article