Computer Science, asked by naskaranubhab03, 1 year ago

JAVA
what is the size of the memory required to store 15 elements of A(14)
I)long type data
ii)short integer type data

Answers

Answered by neha17170
0
long -64 bits or 8 bytes , short -32 bits or 4bytes

naskaranubhab03: But it is told that 15 elements are to be stored
neha17170: long 14*8= 112 byte , short - 4* 14=56
neha17170: 56 bytes
neha17170: sorry
naskaranubhab03: What
neha17170: long = 15*8=120 bytes , short= 15*4= 60 bytes
naskaranubhab03: Is this right
neha17170: ok
Answered by Anonymous
1

Long type for 1 has 64 bits=8 bytes

For 15 elements it will have 15*8bytes

==>120 bytes

Short has 4 bytes alloted for each

Now for 15 elements short will have 4 bytes*15

=60 bytes

Thus the sizes are 120 bytes and 60 bytes

Hope it helps

===========================================================


Similar questions