Thanks, it worked. I tried in a smaller program like this:
import java.text.DecimalFormat;
public class Matte {
public static final double PI = 3.14;
Type: Posts; User: krillov
Thanks, it worked. I tried in a smaller program like this:
import java.text.DecimalFormat;
public class Matte {
public static final double PI = 3.14;
I defined PI like this: public static final double PI = 3.14;
Itīs very strange. I made a simple program and copied your code, but I got the same fail.
import java.text.DecimalFormat;
...
Thanks for you both. I changed like this but it isnīt working correctly I got this result 28.0. It should be 28.26. And if I change the value of "h" in the main then I get this message:
...
Iīm not sure if I did right but I did like this:
public static double volume (int r, int h)
{
DecimalFormat df = new DecimalFormat("#.##");
double volym=PI*r*r*h;
return...
Hi .. I would like to round off a number in a method and return the rounded number. I tried many different ways but I always got the same error message:
Matematik.java:70: error: incompatible...