Int value=20;long lvalue=value; is
Answers
Answered by
0
Explanation:
In the above code 4 bytes integer value is assigned to 8 bytes double value. A data type of higher size (occupying more memory) cannot be assigned to a data type of lower size.
Answered by
0
Given:
Int value = 20; long lvalue = value; is
To find:
Int value = 20; long lvalue = value; is
Solution:
From given, we have,
Int value = 20; long lvalue = value; is
public class IntToLongExample1 {
public static void main (String args[]) {
int i = 20;
long l = i;
System.out.println (l);
}}
Output = 20.
Int has 4 bytes
whereas, long int has 8 bytes.
Similar questions
Business Studies,
5 months ago
Math,
5 months ago
Math,
11 months ago
Physics,
11 months ago
Biology,
1 year ago