# [SOLVED] Code Explaination Help

• 12-12-2008, 11:10 PM
greenco
[SOLVED] Code Explaination Help
I am trying to learn Java and I have been looking at a lot of code samples. I ran across this and I hope that some kind soul will explain the symbols and their meanings.

Code:

``` public class BasicMathDemo {     public static void main(String[] args) {         double a = -191.635;         double b = 43.74;         int c = 16, d = 45;         System.out.printf("The absolute value of %.3f is %.3f%n", a, Math.abs(a));         System.out.printf("The ceiling of %.2f is %.0f%n", b, Math.ceil(b));         System.out.printf("The floor of %.2f is %.0f%n", b, Math.floor(b));         System.out.printf("The rint of %.2f is %.0f%n", b, Math.rint(b));         System.out.printf("The max of %d and %d is %d%n",c, d, Math.max(c, d));         System.out.printf("The min of of %d and %d is %d%n",c, d, Math.min(c, d));```
The code in the "printf" statements do not mean much to me and it would help me a lot if you could explain a couple of them to me as if I was "12 year old".
Thanks
• 12-12-2008, 11:27 PM
CJSLMAN
Come on...
What you are showing is the sample that the Sun Tutorials gives for explaining the math class. Look one topic before (Formatting Numeric print output) and it's all explained there. Just in case you have trouble finding it, here's the link:

Formatting Numeric Print Output (The Java™ Tutorials > Learning the Java Language > Numbers and Strings)

CJSL
• 12-12-2008, 11:31 PM
greenco