Java Tutorial

Java Control Statements

Object Oriented Programming

Java Built-in Classes

Java File Handling

Java Error & Exceptions

Java Multithreading

Java Synchronization

Java Networking

Java Collections

Java List Interface

Java Queue Interface

Java Map Interface

Java Set Interface

Java Data Structures

Java Collections Algorithms

Java Miscellaneous

Advanced Java

Java APIs & Frameworks

Java Useful Resources

Java - toDegrees() Method



Description

The method converts the argument value 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
java_numbers.htm
Advertisements