Basic Math methods
Method Description
[Link]() It will return the Absolute value of the given value.
[Link]() It returns the Largest of two values.
[Link]() It is used to return the Smallest of two values.
[Link]() It is used to round of the decimal numbers to the nearest
value.
[Link]() It is used to return the square root of a number.
[Link]() It is used to return the cube root of a number.
[Link]() It returns the value of first argument raised to the power to
second argument.
[Link]() It is used to find the sign of a given value.
[Link]() It is used to find the smallest integer value that is greater
than or equal to the argument or mathematical integer.
[Link]() It is used to find the Absolute value of first argument along
with sign specified in second argument.
[Link]() It is used to return the floating-point number adjacent to the
first argument in the direction of the second argument.
[Link]() It returns the floating-point value adjacent to d in the
direction of positive infinity.
[Link]() It returns the floating-point value adjacent to d in the
direction of negative infinity.
[Link]() It is used to find the largest integer value which is less than
or equal to the argument and is equal to the mathematical
integer of a double value.
[Link]() It is used to find the largest integer value that is less than or
equal to the algebraic quotient.
[Link]() It returns a double value with a positive sign, greater than or
equal to 0.0 and less than 1.0.
[Link]() It returns the double value that is closest to the given
argument and equal to mathematical integer.
[Link]() It returns sqrt(x2 +y2) without intermediate overflow or
underflow.
[Link]() It returns the size of an ulp of the argument.
[Link]() It is used to return the unbiased exponent used in the
representation of a value.
[Link] It is used to calculate the remainder operation on two
r() arguments as prescribed by the IEEE 754 standard and
returns value.
[Link]() It is used to return the sum of its arguments, throwing an
exception if the result overflows an int or long.
[Link]( It returns the difference of the arguments, throwing an
) exception if the result overflows an int.
[Link]( It is used to return the product of the arguments, throwing an
) exception if the result overflows an int or long.
[Link] It returns the argument incremented by one, throwing an
ct() exception if the result overflows an int.
[Link] It is used to return the argument decremented by one,
ct() throwing an exception if the result overflows an int or long.
[Link]() It is used to return the negation of the argument, throwing an
exception if the result overflows an int or long.
[Link]() It returns the value of the long argument, throwing an
exception if the value overflows an int.
Logarithmic Math Methods
Method Description
[Link]() It returns the natural logarithm of a double value.
Math.log10( It is used to return the base 10 logarithm of a double value.
)
Math.log1p( It returns the natural logarithm of the sum of the argument and 1.
)
[Link]() It returns E raised to the power of a double value, where E is Euler's
number and it is approximately equal to 2.71828.
[Link] It is used to calculate the power of E and subtract one from it.
1()
Trigonometric Math Methods
Method Description
[Link]() It is used to return the trigonometric Sine value of a Given double
value.
[Link]( It is used to return the trigonometric Cosine value of a Given double
) value.
[Link]() It is used to return the trigonometric Tangent value of a Given double
value.
[Link] It is used to return the trigonometric Arc Sine value of a Given double
() value
[Link] It is used to return the trigonometric Arc Cosine value of a Given
() double value.
[Link] It is used to return the trigonometric Arc Tangent value of a Given
() double value.
Hyperbolic Math Methods
Method Description
[Link] It is used to return the trigonometric Hyperbolic Cosine value of a
() Given double value.
[Link] It is used to return the trigonometric Hyperbolic Sine value of a Given
() double value.
[Link] It is used to return the trigonometric Hyperbolic Tangent value of a
() Given double value.
Angular Math Methods
Method Description
[Link] It is used to convert the specified Radians angle to equivalent angle
es measured in Degrees.
[Link] It is used to convert the specified Degrees angle to equivalent
ns angle measured in Radians.
Java Keywords
Java keywords are also known as reserved words. Keywords are particular
words that act as a key to a code. These are predefined words by Java so
they cannot be used as a variable or object name or class name.
List of Java Keywords
A list of Java keywords or reserved words are given below:
1. abstract: Java abstract keyword is used to declare an abstract class. An
abstract class can provide the implementation of the interface. It can have
abstract and non-abstract methods.
2. boolean: Java boolean keyword is used to declare a variable as a boolean
type. It can hold True and False values only.
3. break: Java break keyword is used to break the loop or switch statement.
It breaks the current flow of the program at specified conditions.
4. byte: Java byte keyword is used to declare a variable that can hold 8-bit
data values.
5. case: Java case keyword is used with the switch statements to mark
blocks of text.
6. catch: Java catch keyword is used to catch the exceptions generated by
try statements. It must be used after the try block only.
7. char: Java char keyword is used to declare a variable that can hold
unsigned 16-bit Unicode characters
8. class: Java class keyword is used to declare a class.
9. continue: Java continue keyword is used to continue the loop. It continues
the current flow of the program and skips the remaining code at the
specified condition.
[Link]: Java default keyword is used to specify the default block of code
in a switch statement.
[Link]: Java do keyword is used in the control statement to declare a loop. It
can iterate a part of the program several times.
[Link]: Java double keyword is used to declare a variable that can hold
64-bit floating-point number.
[Link]: Java else keyword is used to indicate the alternative branches in an
if statement.
[Link]: Java enum keyword is used to define a fixed set of constants.
Enum constructors are always private or default.
[Link]: Java extends keyword is used to indicate that a class is derived
from another class or interface.
[Link]: Java final keyword is used to indicate that a variable holds a
constant value. It is used with a variable. It is used to restrict the user
from updating the value of the variable.
[Link]: Java finally keyword indicates a block of code in a try-catch
structure. This block is always executed whether an exception is handled
or not.
[Link]: Java float keyword is used to declare a variable that can hold a 32-
bit floating-point number.
[Link]: Java for keyword is used to start a for loop. It is used to execute a set
of instructions/functions repeatedly when some condition becomes true. If
the number of iteration is fixed, it is recommended to use for loop.
[Link]: Java if keyword tests the condition. It executes the if block if the
condition is true.
[Link]: Java implements keyword is used to implement an
interface.
[Link]: Java import keyword makes classes and interfaces available and
accessible to the current source code.
[Link]: Java instanceof keyword is used to test whether the object is
an instance of the specified class or implements an interface.
[Link]: Java int keyword is used to declare a variable that can hold a 32-bit
signed integer.
[Link]: Java interface keyword is used to declare an interface. It can
have only abstract methods.
[Link]: Java long keyword is used to declare a variable that can hold a 64-
bit integer.
[Link]: Java native keyword is used to specify that a method is
implemented in native code using JNI (Java Native Interface).
[Link]: Java new keyword is used to create new objects.
[Link]: Java null keyword is used to indicate that a reference does not refer
to anything. It removes the garbage value.
[Link]: Java package keyword is used to declare a Java package that
includes the classes.
[Link]: Java private keyword is an access modifier. It is used to indicate
that a method or variable may be accessed only in the class in which it is
declared.
[Link]: Java protected keyword is an access modifier. It can be
accessible within the package and outside the package but through
inheritance only. It can't be applied with the class.
[Link]: Java public keyword is an access modifier. It is used to indicate
that an item is accessible anywhere. It has the widest scope among all
other modifiers.
[Link]: Java return keyword is used to return from a method when its
execution is complete.
[Link]: Java short keyword is used to declare a variable that can hold a 16-
bit integer.
[Link]: Java static keyword is used to indicate that a variable or method is
a class method. The static keyword in Java is mainly used for memory
management.
[Link]: Java strictfp is used to restrict the floating-point calculations to
ensure portability.
[Link]: Java super keyword is a reference variable that is used to refer to
parent class objects. It can be used to invoke the immediate parent class
method.
[Link]: The Java switch keyword contains a switch statement that
executes code based on test value. The switch statement tests the
equality of a variable against multiple values.
[Link]: Java synchronized keyword is used to specify the critical
sections or methods in multithreaded code.
[Link]: Java this keyword can be used to refer the current object in a
method or constructor.
[Link]: The Java throw keyword is used to explicitly throw an exception.
The throw keyword is mainly used to throw custom exceptions. It is
followed by an instance.
[Link]: The Java throws keyword is used to declare an exception.
Checked exceptions can be propagated with throws.
[Link]: Java transient keyword is used in serialization. If you define
any data member as transient, it will not be serialized.
[Link]: Java try keyword is used to start a block of code that will be tested for
exceptions. The try block must be followed by either catch or finally block.
[Link]: Java void keyword is used to specify that a method does not have a
return value.
[Link]: Java volatile keyword is used to indicate that a variable may
change asynchronously.
[Link]: Java while keyword is used to start a while loop. This loop iterates a
part of the program several times. If the number of iteration is not fixed, it
is recommended to use the while loop.
49. Below is the list of reserved keywords in Java:
abstract continue for protected transient
Assert Default Goto public Try
Boolean Do If Static throws
break double implements strictfp Package
byte else import super Private
case enum Interface Short switch
Catch Extends instanceof return void
Char Final Int synchronized volatile
class finally long throw Date
const float Native This while
Valid identifiers:
Following are some examples of valid identifiers in Java:
o TestVariable
o testvariable
o a
o i
o Test_Variable
o _testvariable
o $testvariable
o sum_of_array
o TESTVARIABLE
o jtp123
o JavaTpoint
o Javatpoint123
Invalid identifiers:
Below are some examples of invalid identifiers:
o Test Variable ( We can not include a space in an identifier)
o 123javatpoint ( The identifier should not begin with numbers)
o java+tpoint ( The plus (+) symbol cannot be used)
o a-javatpoint ( Hyphen symbol is not allowed)
o java_&_Tpoint ( ampersand symbol is not allowed)
o Java'tpoint (we can not use an apostrophe symbol in an identifier)
o