In this example we will show you how to use Math.cos() in Java.
Source Code
package com.beginner.examples;
public class Cos {
public static void main(String[] args){
System.out.println(Math.cos(20)); // use Math.cos()
}
}
Output:
0.40808206181339196