- Jun 29, 2002
- 922
- 0
- 76
Whenever I try to compile the attached code, it gives me:
test2.java:45: non-static method getValue() cannot be referenced from a static context
numberz.setValue(numberz.getValue() + x);
^
test2.java:45: non-static method getValue() cannot be referenced from a static context
numberz.setValue(numberz.getValue() + x);
^
2 errors
Can anyone tell me why I'm getting that?
test2.java:45: non-static method getValue() cannot be referenced from a static context
numberz.setValue(numberz.getValue() + x);
^
test2.java:45: non-static method getValue() cannot be referenced from a static context
numberz.setValue(numberz.getValue() + x);
^
2 errors
Can anyone tell me why I'm getting that?