Hello, I was hoping someone could help.
I have a variable in a class that I would like to call in another class in the same package. However when I try calling it I get an "non-static variabe cannot be referenced from a static context". Now my bandaid solution was to just make the variable static and move on with my life. Unfortunatly I'm not allowed to do that. is there any other way for these classes to talk to each other with the variables being static?
I'm also running into the same issue with calling methods from a different class. it gives me the same error saying that method has to be static.
I can post the code if it'll help to understand what im saying
any input would help.. thanks
I have a variable in a class that I would like to call in another class in the same package. However when I try calling it I get an "non-static variabe cannot be referenced from a static context". Now my bandaid solution was to just make the variable static and move on with my life. Unfortunatly I'm not allowed to do that. is there any other way for these classes to talk to each other with the variables being static?
I'm also running into the same issue with calling methods from a different class. it gives me the same error saying that method has to be static.
I can post the code if it'll help to understand what im saying
any input would help.. thanks