Who wants some easy Duke Points
this is copied directly from the Sun's Java Tutorial (see link):
http://java.sun.com/docs/books/tutorial/essential/io/formatting.html
is it a typo?
public class Root2 {
public static void main(String[] args) {
int i = 2;
double r = Math.sqrt(i);
System.out.format("The square root of %d is %f.%n", i,r);
}
}
the line starting with System.out..... gives me the error:
The method format(String, Object[]) in the type PrintStream is not applicable for the arguments
(String, int, double)
I changed things around and got it to work as follows:
public class Root2 {
public static void main(String[] args) {
int i = 7;
double r = Math.sqrt(i);
Number[] n = {Integer.valueOf(i),Double.valueOf(r)};
System.out.format("The square root of %d is %f.%n", n);
}
}

