Core Java Tutorial

Define Java

C vs C++ vs Java

Java Virtual Machine

Java First Program

Java Data Types

Java Tokens

Java Keywords

Java Operators

Operator Precedence

Java Type Casting

Java Statement

Java If statement

Java Switch statement

Java Loops

Java Jumping Statement

Java Arrays 1D

Java Arrays 2D

Java Variable Size Array

Java Vector

Java Math Methods

Java String Methods

Java String Buffer

User-Defined Method

Java Method Overloading

Java Class & Object

Java Constructor

Java Inheritance

Java Interface

Java Packages

Java Multi-threading

Exceptional Handling

File Handling

Java Applets

Java DataBase Connectivity

Page Stats

Visitor: 246

Java Math functions

Java Mathematical functions are in java.lang package. You can use these functions with Math.function_name()

S.No. Method Syntax Description
sin() sin(x); Calculate sin value, x is in radian.
cos() cos(x);
tan() tan(x);
pow() pow(x,y); return the x raised to y
sqrt() sqrt(x); return square root of x
ceil() ceil(x);
floor() floor(x);
abs() abs(a); return absolute value
max() max(a,b); return the maximum number out of a and b.
min() min(a,b); return the minimum number out of a and b.

Value of x and y should be in double, value of a and b may be int, long, float or double.