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