Issue
The code is
public class Multiply
{
public static Double multiply(Double a, Double b)
{
return a * b
}
}
I cannot solve the above code.
I tried a few things, like
public class Multiply
{
public double multiply(double a, double b)
{ return a * b;}
}
It still shows errors in code.
Kindly help, please.
Solution
You essentially had the answer Codewars wanted. I imagine they expected for you to just add the semicolon, as you did, but keep the rest of the code the same.
public class Multiply
{
public static Double multiply(Double a, Double b)
{
return a * b;
}
}
I went to try it out, and this worked for me. Looks like they wanted you to keep static
and the wrapper class Double
.
Answered By - nathantspencer
Answer Checked By - Robin (JavaFixing Admin)