Java BigInteger not() Method

The not() method of Java BigInteger class is used to find the Bitwise NOT of a BigInteger. This method returns a BigInteger whose value is ( ~this).

Syntax:

Parameter:

NA

Returns:

This method returns ( ~this).

Exception:

NA

Note: This method returns a negative value if and only if this BigInteger is positive.

Example 1

Test it Now

Output:

NOT operation on 5 gives -6

Example 2

Test it Now

Output:

NOT operation on -5 gives 4

Example 3

Test it Now

Output:

NOT operation on 15 gives -16

Next TopicJava BigInteger




Latest Courses