| | #1 | |
| Hyper internet marketer War Room Member Join Date: 2010 Location: Europe and Pakistan
Posts: 478
Thanks: 184
Thanked 21 Times in 18 Posts
|
Hello I am new to C# so i was just doing practice with tutorials i get this error: "method must have return type" for those two places: public emp() public emp(string varname,int varage) Help will be apprecited thanks!
| |
| | ||
| |
| | #2 |
| White Hat Marketer War Room Member Join Date: 2007 Location: Montgomeryville, PA
Posts: 1,546
Thanks: 77
Thanked 775 Times in 267 Posts
|
You're trying to create a constructor named "emp", but your class is not named "emp", it's named "Program". A class and its constructor method have the same name. Since this method does not match any class name, the compiler expects you're creating a normal method, not a constructor, and methods have return types. |
| | |
| |
| The Following User Says Thank You to Dan Grossman For This Useful Post: |
| | #3 | |
| Hyper internet marketer War Room Member Join Date: 2010 Location: Europe and Pakistan
Posts: 478
Thanks: 184
Thanked 21 Times in 18 Posts
|
| |
| | ||
| |
|
| Bookmarks |
| Tags |
| coming, error |
| |