I get the error:
for the following simple C# program. I'm a newbie in C# so can sum1 help me out here plz !!HelloWorld.cs(10,20): error CS0122: 'MyName.MyName(int)' is inaccessible due to its protection level
using System; public class HelloWorld { public static int Main( string[] args ) { Console.WriteLine( "Hello C# World" ); int n = 20; MyName M = new MyName( n ); int r = M.GetNumber(); Console.WriteLine( "Number = {0}", r ); return 0; } } public class MyName { int num; MyName( int n ) { num = n; } public int GetNumber( ) { return num; } }
Thanx.