You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the byte primitive data type that allow to overcome the differences between Java and JavaScript.
The byte data type is an 8-bit signed two's complement integer. It has a minimum value of -128 and a maximum value of 127 (inclusive).
Expected Behavior
Declaring a variable to refer to a byte
Creating, Initializing, and Accessing a byte
initialize with hexadecimal
initialize with binary
Equality and Relational Operators
equal to
not equal to
greater than
greater than or equal to
less than
less than or equal to
Arithmetic Operators
additive operator
subtraction operator
multiplication operator
division operator
remainder operator
Unary Operators
unary plus operator
unary minus operator
increment operator
decrement operator
Exception
incompatible types: possible lossy conversion with short, int, long, float o double
incompatible types: cannot be converted to byte
Acceptance test
Declaring a variable to refer to a byte
letaByte: Jbyte;
Creating, Initializing, and Accessing a byte
constaByte=jbyte('26');console.log("Byte: "+aByte);// initialize with hexadecimalconstanHex=jbyte('0x1a');console.log("Hex: "+anHex);// initialize with binaryconstaBin=jbyte('0b11010');console.log("Bin: "+aBin);
Implement the byte primitive data type that allow to overcome the differences between Java and JavaScript.
Expected Behavior
Acceptance test
Declaring a variable to refer to a byte
Creating, Initializing, and Accessing a byte
Output:
Equality and Relational Operators
Output:
Arithmetic Operators
Output:
Unary Operators
Output:
Exceptions
Output:
The text was updated successfully, but these errors were encountered: