Computer Science, asked by sarthakcocth7889, 11 months ago

Int value=20;long lvalue=value; is

Answers

Answered by gauravarduino
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 AditiHegde
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