[Solved] non-static method cannot be referenced from a **static context**. What is static content here? [duplicate]


Your main-method is the static context, and you are trying to call the non-static method display() from it. That doesn’t work even if it is in the same class. To have the disply method non-static you have to do this.

public static void main(String[] args) throws FileNotFoundException{
    ReverseLL r = new ReverseLL();
    r.display(head);

}

public void display(Node head){
    ...
}

solved non-static method cannot be referenced from a **static context**. What is static content here? [duplicate]