Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+18 votes
asked in CSC211_Winter2018 by (1 point)

2 Answers

+16 votes
Best answer

Is this issue occurring when you are trying to return a value? If so, it likely means that the method starts with something like:

public static void methodName() {

When it should be:

public static int methodName(){

if you are trying to return an integer.

answered by (1 point)
selected by
+11 votes

You use “void” when you are not returning a value from a method.
Replace “void” with they type of value you are returning from a method (Double, Int, or String).

answered by (1 point)