Answers for "importing math module in java"

4

import math java

import java.lang.Math.*;

// usage
double radius = 15;
double area = Math.PI * radius * radius;
Posted by: Guest on March-06-2021
0

how to import math lib in java

import static java.lang.Math.sqrt;
public class Demo {
   public static void main(String[] arg) {
      double num = 36.0;
      System.out.println("The number is: " + num);
      System.out.println("The square root of the above number is: " + sqrt(num));
   }
}
Posted by: Guest on August-07-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language