Here is the code:
class Root {
public static void main(String[] arguments) {
int number = 225;
System.out.println("The square root of "
+ number
+ " is "
+ Math.sqrt.(number)
);
}
}
I am learning Java from Sam’s Teach Yourself Java in 24 hours 6th edition and already in chapter four I found something I can’t get to work. The Math.sqrt function is not recognized, so I presume I need to import something to make it work, but the book doesn’t mention anything at all and copying the code verbatim from the author’s website also doesn’t mention it. Also, nothing was mentioned in setting up Netbeans that included changing any options. I am using Netbeans 7.1 which I suspect is the problem. Any workaround? Help?
should be
You got an extra dot there.