I really dont understand why, but it seems like the internal access modifier doesn't work :S
I've looked at this tutorial: http://msdn.microsoft.com/en-us/library/7c5ka91b(v=vs.110).aspx
But for me, it compiles. ALso, i have a bought a book Illustrated C# 2012. And the author explains the internal class etc etc... But still, it doesn't do anything.
Here is my complete code that works EVEN with internal access.
//Program.cs
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Class1 myclass = new Class1(); //works
myclass.display(); //works
myclass.display2(); //works even though its not public :S
Console.Read();
}
}
}
-
//Class1.cs
namespace ConsoleApplication1
{
internal class Class1
{
public void display()
{
Console.WriteLine("display()");
}
internal void display2()
{
Console.WriteLine("display2()");
}
}
}
I can even access the function internal void display2() :S