I cant get this code to work… I don’t know why.
It is the same code as in this tutorial http://www.youtube.com/watch?v=meKpmuUI0ds&feature=related.
The code works when this guy does it, but I get these 2 errors:
Test.java:4: cannot fin symbol symbol: class decimalFormat
location: class Test
decimalFormat decFor = new decimalFormat("0.00");^
Test.java:4: cannot find symbol
symbol: class decimalFormat
location: class Test
decimalFormat decFor = new decimalFormat("0.00"); ^2 errors.
Here’s my code:
public class Test {
public static void main(String[] args) {
decimalFormat decFor = new decimalFormat("0.00");
double money = 15.9;
double mula = 36.6789;
double product = money * mula;
System.out.println(decFor.format(product));
}
}
It is
DecimalFormatnotdecimalFormat, Use IDE to assist you for such mistakesAlso add