Online Java Compiler By
JavaTpoint.com
public class JavaByteLongValueExample3 { public static void main(String[] args) { Byte byte1=20; //converting the byte value to long Long val1=byte1.longValue(); Byte byte2=-9; Long val2=byte2.longValue(); //calling long class methods System.out.println("Sum : "); System.out.print(val1+" + ("+val2+") : "); System.out.println(Long.sum(val1,val2)); } }
Output