i want some info about constructors.
1. What is the need of constructor and destructor?
2. In vb.net is it necessary to define default/parameter less constructor in vb.net when we define any constructor with parameter?
because i create on constructor which takes parameter so at the time of creating the instance of class when i create instance without parameter then its showing error "Arguments not specified for "x"..
Thanks !

Hiren SoniPosted Jul 24, 2010, 1:54 AM
but when you creating constructor your own, then compiler does not define default constructor.
here you are making constructor with parameters
like
form1(
{
}
then compiler doesn't make
default constructor like
form1()
{
}
so when you creating instance of form1, then you must have to pass parameter,
if you still want to create instance with no parameter, then you have to overload constructor one with parameter and other without parameter.
Hope you Understand clearly!
Sam HobbsPosted Jul 23, 2010, 4:16 PM