Online Java Compiler By
JavaTpoint.com
public class ByteValueExample2 { public static void main(String[] args) { Short s1 = -125; //Returns the value of this Short as a byte after a narrowing primitive conversion byte b = s1.byteValue(); System.out.println("byte b value = " + b); } }
Output