Java Byte shortValue() method

The shortValue() method of Java Byte class returns a short value for this Byte after a widening primitive conversion.

Syntax:

Parameters:

NA

Specified by

This method is specified by shortValue in class Number

Return Value

This method returns the numeric value of this object after conversion to type short.

Example 1

Test it Now

Output:

Short value : 98
Short value : 102

Example 2

Test it Now

Output:

20

Next TopicJava Byte




Latest Courses