help! i’m trying to reference a method in another class from my main class but it seems to be saying my main class is static. i don’t think it is? i’m confused
In C# and Java you can’t access a non-static method without creating an instance of the class.
class Test {
public void Func() {}
}
public static void main() {
Test instance = new Test();
instance.Func();
}
public static void main() {
Test.Func();
}
(If Func is marked static
then this is reversed)
1 Like