How to Get Logarithm and Power Values of Numbers using JAVA

Java code is right here to show. 
  1. import java.util.Scanner;  
  2. import java.io.*;  
  3. public class Demo {  
  4.     public static void main(String[] args) throws Exception {  
  5.         BufferedReader br = new BufferedReader(new InputStreamReader(System. in ));  
  6.         System.out.println("1-Want logarithm value of a number..?");  
  7.         System.out.println("2-Want power of a number..?");  
  8.         System.out.println();  
  9.         System.out.print("Select any option: ");  
  10.         int select = Integer.parseInt(br.readLine());  
  11.         switch (select) {  
  12.             case 1:  
  13.                 System.out.print("Enter the number: ");  
  14.                 Scanner in = new Scanner(System. in );  
  15.                 float input = in .nextFloat();  
  16.                 System.out.println("Natural logarithm value of " + input + " is : " + Math.log(input));  
  17.                 break;  
  18.             case 2:  
  19.                 System.out.print("Enter the number: ");  
  20.                 Scanner s = new Scanner(System. in );  
  21.                 int input1 = s.nextInt();  
  22.                 System.out.print("Enter the power value: ");  
  23.                 int input2 = s.nextInt();  
  24.                 System.out.println("The value of " + input1 + " raised to the power " + input2 + " is: " + Math.pow(input1, input2));  
  25.                 break;  
  26.         }  
  27.     }  
  28. }  
 Thank you, keep learning and sharing.