But when I type
public void setGweight(int x) {
if (x != -0) {
return false; //error reads saying: cannot return a value from method whose result type is void--Unnecessary return...
Type: Posts; User: Vessel06
But when I type
public void setGweight(int x) {
if (x != -0) {
return false; //error reads saying: cannot return a value from method whose result type is void--Unnecessary return...
You know what...I totally forgot abt using an if statement! lol But she didn't say what the code is supposed to do if it detects a negative number, but to make sure that it CAN'T be a negative number...
:confused:
So this is a hw assignment and I'm having a little trouble with it. I am a beginner (first programming class EVER) but I'm a quick learner so bare with me lol :-)
The assignment is...