Computer Science, asked by aman843, 1 year ago

difference between byte and integer size

Answers

Answered by vbk185
3
The eight primitive data types supported by the Java programming language are:byte: The byte data type is an 8-bit signed two's complement integer. ... In Java SE 8 and later, you can use the int data type to represent an unsigned 32-bit integer, which has a minimum value of 0 and a maximum value of 232-1.
Answered by srishti78
2

A byte is 2^8 so there are only 256 combinations while an integer is 2^32 (4 bytes) and has 4294967296 combinations




Only difference is with the range of values it can hold.

Byte variable can hold values from -127 to +128. Bytes consists of 8 bits.

In C# integer is of 4 bytes.. so has more range.

I hope that helps.
Similar questions