Wednesday, January 29, 2014

Using exponents in java

Example: 83 = 8 × 8 x 8 = 512

Source:
public class Exponents {
   public static void main(String[] args) {
      System.out.println(Math.pow(8, 3));
   }
}

Output:
   $ java Exponents 
   512.0

Blog Archive