The toHexString() method of Java Integer class returns a string representing the specified int argument as an unsigned integer in base 16.

Syntax

public static String toHexString (int  i) 

Parameters

The parameter ‘i’ represents an integer to be converted to a string.

Return Value

This method returns the string which represents the unsigned integer value of the argument in hexadecimal.

Example 1

Output

Example 2

Output

Example 3

Output

Example 4

Output

Pin It on Pinterest

Share This