Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Java toDegrees() Method

Java toDegrees() Method

Java Number ClassThe Java Number class


The toDegrees() method converts the argument into degrees.

Syntax



double toDegrees(double d)

Parameters

Return Value

The method returns a double value.

Example



public class Test{

    public static void main(String args[]){

        double x = 45.0;

        double y = 30.0;



        System.out.println( Math.toDegrees(x) );

        System.out.println( Math.toDegrees(y) );

    }

}

Compile the above program; the output is:



2578.3100780887044

1718.8733853924698


Java Number ClassThe Java Number class