Java Short byteValue() MethodThe byteValue() method of Java Short class is a wrapper class. SyntaxParametersN/A Return valueReturns the value of this Short class as a byte after a narrowing primitive conversion. If we override byteValue in Number class then it will return Numeric Value represented by this object after conversion to byte type. Example 1Test it NowOutput: Byte b = 45 Example 2Test it NowOutput: byte b value = -125 Example 3Test it NowOutput: byte Value of b = 68 Example 4Test it NowOutput: byte Value of b = -119 Example 5Test it NowOutput: 55
Next TopicJava Short
|