title: Does Java have an exponential operator?
body: <p>Is there an exponential operator in Java?</p>
  
  <p>For example, if a user is prompted to enter two numbers and they enter <code>3</code> and <code>2</code>, the correct answer would be <code>9</code>.</p>
  
  <pre><code>import java.util.Scanner;
  public class Exponentiation {
  
      public static double powerOf (double p) {
          double pCubed;
  
          pCubed = p*p;
          return (pCubed);
      }
  
      public static void main (String [] args) {
          Scanner in = new Scanner (System.in);
  
          double num = 2.0;
          double cube;    
  
          System.out.print ("Please put two numbers: ");
          num = in.nextInt();
  
          cube = powerOf(num);
  
          System.out.println (cube);
      }
  }
  </code></pre>