chaithanya

chaithanya

  • NA
  • 100
  • 0

using constructors

Jul 30 2008 2:26 AM
I have a doubt in creating constructors
I have a program below
class classname
{
public void classname()        \\constructor
{
Console.WriteLine("Hai");
}
public static void Main(string[] args)
{
classname obj=new classname();
}
}
while executing this it gives an error method should not have same name classname
what is reason  and what is the solution for this?


Answers (1)