0

I have an assignment for school that involves creating a java program that creates a basic class.

I'm getting an error missing return statement, if i try to compile.

What could be wrong here?

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by VernonDozier
0

missing return statement means that your method expects you to return a value. for example :

int add(int x, int y) {
  return x+y;
}

if your method does not return a value its signature need to be like this:

void foo() {
// some code here
}
0

yeah i duno if i can post my code on here, but if someone can reply, i need to see if i'm on the right track, i wanna send them my code in a private message and if its correct?

starting to bug me and i duno what im doing wrong. thx

0

yeah i duno if i can post my code on here, but if someone can reply, i need to see if i'm on the right track, i wanna send them my code in a private message and if its correct?

starting to bug me and i duno what im doing wrong. thx

Yeah, you can post your code here, that's the whole idea. PMs with code are discouraged on this site. It's better to post it for everyone so everyone can see it and people with the same problem can learn from it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.