In this example we will show how to find an exponential value of a number using exp method of Math class in Java.
Source Code
package com.beginner.examples;
public class ExpExample {
public static void main(String[] args){
//return e raised to argument value.
System.out.println("Exponential of 4 is : " + Math.exp(4));
System.out.println("Exponential of 1 is : " + Math.exp(1));
}
}
Output:
Exponential of 4 is : 54.598150033144236