I wish to know whether following highlighted method headers have a default access modifier. Is there any way to find out default access modifier?
using System;
class CreateEmployee
{
static void Main()
{
Employee myAssistant = new Employee();
myAssistant.SetId(345);
Console.WriteLine("ID # is {0}", myAssistant.GetId());
Console.ReadKey();
}
}
class Employee
{
int idNumber;
public int GetId()
{
return idNumber;
}
public void SetId(int id)
{
idNumber = id;
}
}
Default access modifier
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Aug 31, 2013, 7:21 AM EDT
So if you'd omitted the public access modifier on those two methods, they'd have been private by default and, hence, only callable from within the class itself.
Posted Aug 31, 2013, 7:36 AM EDT