Scala Int toHexString() method with example
Last Updated :
30 Jan, 2020
The toHexString() method is utilized to return the hexa decimal form of the specified integer value.
Method Definition: def toHexString: String
Return Type: It returns the Hexa decimal form of the specified integer value.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 5 ).toHexString
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 18 ).toHexString
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...