logo

Java ToDegrees() Method


Show

Description

The method alters the argument value to degrees. toDegrees() is an integral technique in java that converts row value to degrees. Parameters: The parameter is obligatory and has to be of a twice data type. The bypassed parameter is thus adapted to degrees.

Syntax

double toDegrees(double d)

Parameters

Here is the detail of parameters −

  • d − A double data type.

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

This will produce the following result:

Output

2578.3100780887044
1718.8733853924698

Here at Intellinuts, we have created a complete Java tutorial for Beginners to get started in Java.