Cruz100 Cruz100 - 1 month ago 11
Java Question

Void error converting from double, but there is no void in my code

I have made some code, but now it keeps giving me an error :

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - incompatible types: void cannot be converted to double.

Thing is there are no void methods in my code.

public double separatingcomputation(){

startingTimeinminutes = startingTime / 100;
elapsedminutes = (double)startingTimeinminutes; //Minutes captured before losing to int

startingTimeinhours = (int) startingTimeinminutes; //Starting hours

endingTimeinminutes = endingTime /100;
endingTimeinminutes = (double)endingTimeinminutes; //Minutes captured before losing to int
endingTimeinhours = (int) endingTimeinminutes; //Ending hours

elapsedminutes = ((double)elapsedminutes - startingTimeinhours ) * 100; //Get starting the minutes
endingTimeinminutes = ((double)endingTimeinminutes - endingTimeinhours) * 100; //Get ending the minutes

startingTimeinhours = (double) ((startingTimeinhours - 12) * 60 + elapsedminutes) / 60;



return (double) startingTimeinhours ;

Answer

Maybe it was restarting the program or the fact that I copied and re-pasted the code but its not giving me the error now. whatever the case it seems to have been solved and it wasn't a major thing. thanks.