The code you show will not compile - not because of a protection level, but becasue you must declare constructors with an appropriate protection declaration:
public
or
private
for example:
public class ClassA
{
public ClassA(int var)
{ }
public static void tm()
{ }
}
class Program
{
public static void Main(string[] args)
{
ClassA obj = new ClassA(1);
}
}
If you then uncomment your
tm
method access, you will get a different error:
cannot be accessed with an instance reference; qualify it with a type name instead
because it is a static method - and you need to access those via the Class name instead:
public static void Main(string[] args)
{
ClassA obj = new ClassA(1);
ClassA.tm();
}
[edit]Typos - twice - I hate IE, I hate IE... - OriginalGriff[/edit]