how to find powers in java

Java
int n=Math.pow(N, P); 
Source

Also in Java: