What is the range of byte data type?

class DataType1
{
public static void main(String[] args)
{
byte b=128;
System.out.println(b);
}
}
/*
Output:- CE[Possible loss of precision]
Explanation:- "byte" data type have range between -128 to 127. If we are trying to
assign a value greater than its range then it will rise compilation error.
*/

0 comments: