Source Code : Use static import to bring sqrt() and pow() into view.

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Use static import to bring sqrt() and pow() into view.

Use static import to bring sqrt() and pow() into view.

import static java.lang.Math.pow;
import static java.lang.Math.sqrt;

public class Hypot {
  public static void main(String args[]) {
    double side1, side2;
    double hypot;

    side1 = 3.0;
    side2 = 4.0;

    hypot = sqrt(pow(side1, 2) + pow(side2, 2));

    System.out.println("Given sides of lengths " + side1 + " and " + side2 + " the hypotenuse is "
        + hypot);
  }
}


           
       

Thank with us