Easy Tutorial
❮ Collection Rotate Java Hashmap Getorindex ❯

Java toDegrees() Method

Java Number Class


The toDegrees() method is used to convert the argument to degrees.

Syntax

double toDegrees(double d)

Parameters

Return Value

This 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) );
    }
}

Compiling the above program produces the following output:

2578.3100780887044
1718.8733853924698

Java Number Class

❮ Collection Rotate Java Hashmap Getorindex ❯