"non-static method cannot be referenced from a static context"

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

Hey @SarahBogel welcome to the forums!

Can you please provide a link to the repl?


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();



public static void main() {

(If Func is marked static then this is reversed)

1 Like