I have a private static class and I am trying to access AddtwoNum()
method from SomePrivateClass to SomePublicClass in C# and It is not allowing me to do so.
class SomeClass
{
private static class SomePrivateClass
{
public static void AddtwoNum(int num1, int num2)
{
//do some stuff here
}
}
class SomePublicClass
{
SomePrivateClass.AddtwoNum(); //Error: The name AddtwoNum does not exist in the current context.
// how to call AddtwoNum() method here???
}
}