|
-
Jul 8th, 2010, 01:10 PM
#3
Frenzied Member
Re: Some explanation about constructor in c#
 Originally Posted by firoz.raj
Can anyone tell me ???Why the following code is not working ?let me know some idea.
Code:
using System;
using System.Collections.Generic;
using System.Text;
namespace Example9
{
class Program
{
static void Main(string[] args)
{
Public String Program();
{
Console.WriteLine("I am a Constructor");
return;
}
}
}
}
hay firoz.raj,
i believe here that you want to create a constructor.
the constructor must be with the same name of the class, in your case it will be Program.
you added method definition inside another method, and this is wrong.
please see this link
http://www.c-sharpcorner.com/UploadF...sInCSharp.aspx
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|