Saturday, November 27, 2010

Java Tutorial #5

0
Different Math Class in Java


This topic will include multiple Math Class Function that is very applicable to Java Programming.  There are so many Math Class Function to Java Programming but I will only mention some of it (The Function that very commonly use to some applications).  So, Let get Started.

Build in Function for PI = 3.1416;
   Math.PI*value is a reserved keyword in Java.  This keyword will automatically initialize the nearest value of PI.  This is commonly used keyword for finding the Area, the circumference, and volume of different circular figures.  Consider the first bunch of codes in the program.

Build in Function for Absolute Value
    Math.abs(value) is also a reserved word in Java Programming. This keyword will automatically omit the negative signs to your integer.  It will convert the negative integer into positive.  Look for the second group of codes inside the program below.

Build Function for Maximum and Minimum
    This Function will take two arguments.  The two value you want to compare.  You can assign the value to a variable or you can directly type it.  Math.max(value1, value2) for maximum and Math.min(value1, value2) for minimum.



No Response to "Java Tutorial #5"

Post a Comment