Computer Science, asked by bhavanij72, 1 month ago

State with reason why the following are in correct
(i) int a=5;
short b=a;

Answers

Answered by rajavamsi566
1

Answer:

This is not accepted in Java.

Explanation:

The reason for this is because, the range of an int data structure is b/w -2^3^1 to 2^3^1-1, whereas the range for short is -2^1^5 to 2^1^5-1.

Similar questions