Javatpoint Logo
Javatpoint Logo

Java Integer intValue() Method

The intValue() method is an instance method of Integer class under java.lang package. This method returns the value of the specified number as an int. It is inherited from the Number Class.

Syntax:

Following is the declaration of intValue() method:

Parameter:

DataType Parameter Description
NA NA This method does not accepts any parameter.

Returns:

The intValue() method returns the numeric value represented by this object after conversion to type int.

Exceptions:

NA

Compatibility Version:

Java 1.2 and above

Example 1

Test it Now

Output:

Value of i is: 25

Example 2

Test it Now

Output:

Integer Value of X: 568
Integer Value of Y: 55

Example 3

Output:

Enter The Desired Integer Value: 2342
Integer Value is: 2342

Example 4

Test it Now

Output:

Value is = 13

Next TopiclongValue() Method




Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA