I have two methods one in the main class and one in a class called 'DeleteWall' .I'm creating instances of each class so I can access their methods .I've read all the posts on stackOverflows but I don't see what i'm doing wrong ...like i'm not looping it to make a new instance as far as I can see anyway.I'll highlight the lines which are causing the errors as intellij says.I'm only calling demo once aswell .Oh and the method 'delNode' is in the main class hence the instance of it 'werk'.
//Main class
DeleteWall ok=new DeleteWall(); //error line
public void demo(){
System.out.println("running");
ok.delWalls(30,0,30,30);
System.out.println("didnt stop");
}
//DeleteWall class
public class DeleteWall {
Main werk = new Main(); //error line
public void delWalls(int Sx, int Sy, int Ex, int Ey) {
werk.delNode(Sx, Sy, Ex, Ey);
}
}