0
Please help me im a java newbie
what do you mean by "returns an int value 5" does it return value 5 to the main method or what? // returns an int value 5 static int returnFive() { return 5; }
2 Antworten
0
Yes. Wherever you call the function you get a 5.
0
If you were to call "returnFive()" from the main method, say, the method "returnFive()" would return the value "5" back to where it was called from. So, if you call it like this:
int a = returnFive();
It would run "returnFive()", which would return a value of five, of which the variable "a" would be assigned to have a value of.